Compare commits
10 Commits
84f5fd651d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a5d9e5a89c | |||
| 02722f3275 | |||
| 9ff3c7225a | |||
| 9a3b2d95a6 | |||
| e5221ea19f | |||
| 86650612fe | |||
| 1ed185cf89 | |||
| 98642a9239 | |||
| 42c0f67990 | |||
| ada7809acf |
@ -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 -->
|
||||
|
||||
@ -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 -->
|
||||
|
||||
@ -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/
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||

|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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`.
|
||||
|
||||
@ -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/
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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!
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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`
|
||||
|
||||
@ -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
|
||||
|
||||
27
README.md
27
README.md
@ -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>`
|
||||
[](https://youtu.be/RqTEHSBrYFw)
|
||||
|
||||
## Sponsor
|
||||
|
||||
[](https://shipyard.build)
|
||||
[](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
BIN
readme-assets/thumbnail.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Reference in New Issue
Block a user