Compare commits

..

10 Commits

Author SHA1 Message Date
a5d9e5a89c added top nav links to READMEs (#12) 2025-02-16 18:57:05 -05:00
02722f3275 Update README.md (#28) 2025-02-16 18:54:42 -05:00
9ff3c7225a add redeploy-all make target for docker swarm 2023-05-12 15:13:54 -04:00
9a3b2d95a6 direct to mainpage links (#7) 2023-04-26 19:33:17 -04:00
e5221ea19f update links 2023-04-25 12:47:11 -04:00
86650612fe Launch readme update (#6)
* update repo for launch
* update logo link
2023-04-25 07:38:37 -04:00
1ed185cf89 remove unnecessary --link option 2023-04-21 14:43:35 -04:00
98642a9239 add route rewrites 2023-04-18 14:19:01 -04:00
42c0f67990 add shipyard labels 2023-04-18 14:15:16 -04:00
ada7809acf Update README.md 2023-04-07 09:20:08 -04:00
18 changed files with 223 additions and 17 deletions

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# History and Motivation
<!-- no toc -->

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Technology Overview
<!-- no toc -->

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Installation and Set Up
Docker Desktop: https://docs.docker.com/get-docker/

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Using 3rd party containers
**Table of contents:**
@ -287,6 +302,7 @@ https://hub.docker.com/_/mysql
docker run -d --rm \
-v mysqldata:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=foobarbaz \
-p 3306:3306 \
mysql:8.0.32
# With custom conf.d
@ -294,6 +310,7 @@ docker run -d --rm \
-v mysqldata:/var/lib/mysql \
-v ${PWD}/conf.d:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=foobarbaz \
-p 3306:3306 \
mysql:8.0.32
```

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Sample web application
![](./readme-assets/app-screenshot.png)

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Building Container Images
## Building the Dockerfiles in this Repo

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Container Registries
A container registry is a repository, or collection of repositories, used to store and access container images. They serve as a place to store and share container images between developer systems, continuous integration servers, and deployment environments.

View File

@ -59,7 +59,6 @@ docker-run-all:
-e DATABASE_URL=${DATABASE_URL} \
-p 3000:3000 \
--restart unless-stopped \
--link=db \
api-node
docker run -d \
@ -68,7 +67,6 @@ docker-run-all:
-e DATABASE_URL=${DATABASE_URL} \
-p 8080:8080 \
--restart unless-stopped \
--link=db \
api-golang
docker run -d \
@ -77,8 +75,6 @@ docker-run-all:
-v ${PWD}/client-react/vite.config.js:/usr/src/app/vite.config.js \
-p 5173:5173 \
--restart unless-stopped \
--link=api-node \
--link=api-golang \
client-react-vite
docker run -d \
@ -86,8 +82,6 @@ docker-run-all:
--network my-network \
-p 80:8080 \
--restart unless-stopped \
--link=api-node \
--link=api-golang \
client-react-ngnix
.PHONY: docker-stop

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Running Containers (with Docker)
There are two primary ways to run docker containers, with `docker run` and `docker compose up`.

View File

@ -12,6 +12,9 @@ services:
ports:
- 5173:5173
client-react-nginx:
labels:
shipyard.primary-route: true
shipyard.route: '/'
image: client-react-nginx
build:
context: ../05-example-web-application/client-react/
@ -23,6 +26,9 @@ services:
- 80:8080
restart: unless-stopped
api-node:
labels:
shipyard.route: '/api/node/'
shipyard.route.rewrite: true
image: api-node
build:
context: ../05-example-web-application/api-node/
@ -39,6 +45,9 @@ services:
- 3000:3000
restart: unless-stopped
api-golang:
labels:
shipyard.route: '/api/golang/'
shipyard.route.rewrite: true
image: api-golang
build:
context: ../05-example-web-application/api-golang/

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Container Security
There are two main considerations when it comes to container security (1) the contents of your container image and (2) the security of the execution configuration and environment.

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Interacting with Containers and Other Docker Objects
Familiarize yourself with the docker command line!

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Development Workflow
## Development Environment

View File

@ -1,3 +1,18 @@
[Home](../README.md) | [History and Motivation](../01-history-and-motivation/README.md)
| [Technology Overview](../02-technology-overview/README.md)
| [Installation and Set Up](../03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](../04-using-3rd-party-containers/README.md)
| [Example Web Application](../05-example-web-application/README.md)
| [Building Container Images](../06-building-container-images/README.md)
| [Container Registries](../07-container-registries/README.md)
| [Running Containers](../08-running-containers/README.md)
| [Container Security](../09-container-security/README.md)
| [Interacting with Docker Objects](../10-interacting-with-docker-objects/README.md)
| [Development Workflows](../11-development-workflow/README.md)
| [Deploying Containers](../12-deploying-containers/README.md)
---
# Deploying containers
One of the major benefits of containerization is that it provides a standard interface that others can use to design their systems. Because of this, TONS of different options are available for deploying containers to the cloud.
@ -34,7 +49,7 @@ At this point, we already have a `docker compose` file which allows us to specif
Luckily, docker swarm does provide those things and setting up a single node cluster can be done with one command `docker swarm init`. Making just a few modifications to the docker compose file (adding `deploy` configurations, passing sensitive info as secrets and reading those data as files within the applications) it is ready to deploy.
1) Create a virtual machine with your favorite cloud provider. Make sure to set up the firewall to listen on ports 80, 443, and 22.
2) Use the script at https://get.docker.com/ to install docker engine
2) Use the script at https://get.docker.com/ to install docker engine. If managing docker as a non-root user, you may need to follow these steps: https://docs.docker.com/engine/install/linux-postinstall/ after installing.
3) Set the `DOCKER_HOST` environment variable in the Makefile to `USERNAME@IP_ADDRESS` of your virtual machine (this will allow your local docker client to use the remote docker daemon!)
4) Build and push the container images to a registry
5) Populate the secrets by running `make create-secrets`

View File

@ -41,3 +41,11 @@ create-secrets:
.PHONY: delete-secrets
delete-secrets:
DOCKER_HOST=${DOCKER_HOST} docker secret rm postgres-passwd database-url
.PHONY: redeploy-all
redeploy-all:
-$(MAKE) swarm-remove-stack
-$(MAKE) delete-secrets
@sleep 3
-$(MAKE) create-secrets
-$(MAKE) swarm-deploy-stack

View File

@ -1,18 +1,31 @@
[History and Motivation](01-history-and-motivation/README.md)
| [Technology Overview](02-technology-overview/README.md)
| [Installation and Set Up](03-installation-and-set-up/README.md)
| [Using 3rd Party Containers](04-using-3rd-party-containers/README.md)
| [Example Web Application](05-example-web-application/README.md)
| [Building Container Images](06-building-container-images/README.md)
| [Container Registries](07-container-registries/README.md)
| [Running Containers](08-running-containers/README.md)
| [Container Security](09-container-security/README.md)
| [Interacting with Docker Objects](10-interacting-with-docker-objects/README.md)
| [Development Workflows](11-development-workflow/README.md)
| [Deploying Containers](12-deploying-containers/README.md)
---
# DevOps Directive Docker Course
**NOTE:** The course video will be released to YouTube in Spring 2023!
This is the companion repo to: [Complete Docker Course - From BEGINNER to PRO! (Learn Containers)](https://youtu.be/RqTEHSBrYFw)
This is the companion repo to: `<INSERT VIDEO LINK>`
`<INSERT THUMBNAIL IMAGE>`
[![](./readme-assets/thumbnail.jpg)](https://youtu.be/RqTEHSBrYFw)
## Sponsor
[![](./readme-assets/shipyard-logo.png)](https://shipyard.build)
[![](./readme-assets/shipyard-logo.png)](https://shipyard.build/)
Thank you to Shipyard for sponsoring this course. It is because of their support that I am able to provide it to the community free of charge!
Thank you to [Shipyard](https://shipyard.build/) for sponsoring this course! It is because of their support that I am able to provide it to the community free of charge!
Shipyard is the easiest way to generate on demand ephemeral environments (aka a new environment for every pull request). Check them out at https://shipyard.build/!
Shipyard is the easiest way to generate on demand ephemeral environments (aka a new environment for every pull request). Sign up today at https://shipyard.social/DevOpsDirectivePromo! The first 300 people to use the promo code "DEVOPSDIRECTIVE" will receive an additional 30 days free on either their startup or business tier plans!
## [01 - History and Motivation](01-history-and-motivation/README.md)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 26 KiB

BIN
readme-assets/thumbnail.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB