Skip to content

Commit

Permalink
Merge branch 'main' into ISSUE-90
Browse files Browse the repository at this point in the history
  • Loading branch information
BretFisher authored Feb 13, 2024
2 parents 4ad1b57 + cbba283 commit 2ad6589
Show file tree
Hide file tree
Showing 21 changed files with 1,271 additions and 21 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,7 @@ $RECYCLE.BIN/
*.lnk

# vscode tmp files
.dccache
.dccache

# reference pdf's
references/*.pdf
52 changes: 40 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,45 @@
# Udemy Course Docker Mastery: with Kubernetes+Swarm from a Docker Captain

[![Lint Code Base](https://github.com/BretFisher/udemy-docker-mastery/actions/workflows/call-super-linter.yaml/badge.svg)](https://github.com/BretFisher/udemy-docker-mastery/actions/workflows/call-super-linter.yaml)

> Build, test, deploy containers with the best mega-course on Docker, Kubernetes, Compose, Swarm and Registry using DevOps
This repository is for use in my Udemy Courses "Docker Mastery" and "Swarm Mastery"

NOTE: As of July 2020 the new default branch is `main`, so please update your clone if you're still on `master` branch.

Get these courses for with my "cheapest on the internet" coupon links:

[bretfisher.com/courses](https://www.bretfisher.com/courses)

My other DevOps and Docker resources are at [bretfisher.com/docker](https://www.bretfisher.com/docker)
> Build, test, and deploy containers with the best mega-course on Docker, Kubernetes, Compose, Swarm and Registry using a cloud native DevOps mindset
This repository is for use in my Udemy Courses "[Docker Mastery](https://www.udemy.com/course/docker-mastery/?referralCode=1410924A733D33635CCB
)" and "[Swarm Mastery](https://www.udemy.com/course/docker-swarm-mastery/?referralCode=4927D9CB156D4AE0228C)"

- Get these courses with my "cheapest on the internet" coupon links: [bretfisher.com/courses](https://www.bretfisher.com/courses)
- Get the [weekly newsletter](https://www.bretfisher.com/newsletter) on all the cloud native DevOps content I'm creating.

## Course Sections

1. Quick Start!
1. [README](./intro/README.md)
2. [Commands and Links](./references/S01%20Commands%20and%20Links.md)
2. Course Introduction
3. The Best Way to Setup Docker for Your OS
4. Creating and Using Containers Like a Boss
5. Container Images, Where To Find Them and How To Build Them
6. Container Lifetime & Persistent Data: Volumes, Volumes, Volumes
7. Making It Easier with Docker Compose: The Multi-Container Tool
8. Swarm Intro and Creating a 3-Node Swarm Cluster
9. Swarm Basic Features and How to Use Them In Your Workflow
10. Swarm App Lifecycle
11. Container Registries: Image Storage and Distribution
12. Docker in Production
13. The What and Why of Kubernetes
14. Kubernetes Architecture and Install
15. Your First Pods
16. Inspecting Kubernetes Resources
17. Exposing Kubernetes Ports
18. Kubernetes Management Techniques
19. Moving to Declarative Kubernetes YAML
20. Your Next Steps and The Future of Kubernetes
21. Automated CI Workflows
22. GitHub Actions Workflow Examples
23. Docker Security Good Defaults and Tools
24. Docker 19.03 Release New Features
25. DevOps and Docker Clips
26. Dockerfiles and Docker Images in 2022
27. Dockerfile and Compose File Reviews
28. Extra's, Common Questions, and Resources

Feel free to create issues or PRs if you find a problem with examples in this repository!
16 changes: 8 additions & 8 deletions dockerfile-sample-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
# to match the latest standards from docker hub... but it's doing the same thing as the video
# describes

FROM debian:bullseye-slim
FROM debian:bookworm-slim
# all images must have a FROM
# usually from a minimal Linux distribution like debian or (even better) alpine
# if you truly want to start with an empty container, use FROM scratch

LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"

# optional environment variable that's used in later lines and set as envvar when container is running
ENV NGINX_VERSION 1.23.4
ENV NJS_VERSION 0.7.11
ENV PKG_RELEASE 1~bullseye
ENV NGINX_VERSION 1.25.3
ENV NJS_VERSION 0.8.2
ENV PKG_RELEASE 1~bookworm


RUN set -x \
# create nginx user/group first, to be consistent throughout docker variants
&& addgroup --system --gid 101 nginx \
&& adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid 101 nginx \
&& groupadd --system --gid 101 nginx \
&& useradd --system --gid nginx --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y gnupg1 ca-certificates \
&& \
Expand Down Expand Up @@ -50,13 +50,13 @@ RUN set -x \
&& case "$dpkgArch" in \
amd64|arm64) \
# arches officialy built by upstream
echo "deb [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bullseye nginx" >> /etc/apt/sources.list.d/nginx.list \
echo "deb [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \
&& apt-get update \
;; \
*) \
# we're on an architecture upstream doesn't officially build for
# let's build binaries from the published source packages
echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bullseye nginx" >> /etc/apt/sources.list.d/nginx.list \
echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \
\
# new directory for storing sources and .deb files
&& tempDir="$(mktemp -d)" \
Expand Down
113 changes: 113 additions & 0 deletions references/S008 Swarm Intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Swarm Intro and Creating a 3-Node Swarm Cluster

## Create Your First Service and Scale it Locally

docker info

docker swarm init

docker node ls

docker node --help

docker swarm --help

docker service --help

docker service create alpine ping 8.8.8.8

docker service ls

docker service ps frosty_newton

docker container ls

docker service update TAB COMPLETION --replicas 3

docker service ls

docker service ps frosty_newton

docker update --help

docker service update --help

docker container ls

docker container rm -f frosty_newton.1.TAB COMPLETION

docker service ls

docker service ps frosty_newton

docker service rm frosty_newton

docker service ls

docker container ls

## Creating a 3-Node Swarm Cluster

http://play-with-docker.com

docker info

docker-machine

docker-machine create node1

docker-machine ssh node1

docker-machine env node1

docker info

http://get.docker.com

docker swarm init

docker swarm init --advertise-addr TAB COMPLETION

docker node ls

docker node update --role manager node2

docker node ls

docker swarm join-token manager

docker node ls

docker service create --replicas 3 alpine ping 8.8.8.8

docker service ls

docker node ps

docker node ps node2

docker service ps sleepy_brown

## Scaling Out with Overlay Networking

docker network create --driver overlay mydrupal

docker network ls

docker service create --name psql --netowrk mydrupal -e POSTGRES_PASSWORD=mypass postgres

docker service ls

docker service ps psql

docker container logs psql TAB COMPLETION

docker service create --name drupal --network mydrupal -p 80:80 drupal

docker service ls

watch docker service ls

docker service ps drupal

docker service inspect drupal
30 changes: 30 additions & 0 deletions references/S01 Quick Start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Quick Start!

> Shell commands and reference links, per lecture
## What is Docker? The Three Innovations

- [Article of this lecture](https://github.com/BretFisher/udemy-docker-mastery/blob/main/intro/what-is-docker/what-is-docker.md)
- [Kubernetes vs. Docker](https://www.bretfisher.com/kubernetes-vs-docker/)
- [OCI Overview](https://opencontainers.org/about/overview/)

## Quick Container Run

- [Article of this lecture](https://github.com/BretFisher/udemy-docker-mastery/blob/main/intro/quick-container-run/quick-container-run.md)
- [Play with Docker](https://labs.play-with-docker.com/)
- [Docker Hub](https://hub.docker.com/)
- [Docker Official Images](https://docs.docker.com/docker-hub/official_images/)
- [Apache Official Image (httpd)](https://hub.docker.com/_/httpd)

```shell
docker version
docker run -d -p 8800:80 httpd
curl localhost:8800
docker ps
docker run -d -p 8801:80 httpd
```

## Why Docker? Why Now?

- [Article of this lecture](https://github.com/BretFisher/udemy-docker-mastery/blob/main/intro/why-docker/why-docker.md)
- [A Brief History of Containers](https://blog.aquasec.com/a-brief-history-of-containers-from-1970s-chroot-to-docker-2016)
Loading

0 comments on commit 2ad6589

Please sign in to comment.