This repository is a todo application for the Docker Master Class.
The application is based on the application from the Getting Started tutorial at https://github.com/docker/getting-started
- Docker Master Class
- Task 00 - Demonstration of Working Linux Namespaces and Cgroups
- Task 01 - Build an Image Based on Ubuntu
- Task 02 - Build an Image Based on Ubuntu with Optimized Layers
- Task 03 - Build an Image Based on Ubuntu with Optimized Layers and Cleanup Cache
- Task 04 - Build an Image on Node Alpine
- Task 05 - Build an Image on Node Alpine with Optimized Layers and Security Enhancements
- Task 06 - Multi-Stage Build with Docker Volume Demonstration
- Task 07 - Docker Compose Demonstration
docker build -t sleep-alpine -<<EOF
FROM alpine
ENTRYPOINT ["sleep"]
CMD ["3600"]
EOF
docker run --name sleep-alpine --memory=100m --cpus=".2" -d sleep-alpine
docker exec -it sleep-alpine /bin/sh
sudo lsns
sudo nsenter -t <container_pid> --pid --net --mount --ipc --uts sh
sudo systemd-cgls
cd /sys/fs/cgroup/system.slice/docker-<container_id>
cat memory.max | awk '{$1=$1/1024/1024; print}'
cat cpu.max
docker build --no-cache -t todos-app-task-01 -f task01/Dockerfile .
docker run -dp 3000:3000 --name todos-app-task-01 todos-app-task-01
docker stop todos-app-task-01 && docker rm todos-app-task-01
docker build --no-cache -t todos-app-task-02 -f task02/Dockerfile .
docker run -dp 3000:3000 --name todos-app-task-02 todos-app-task-02
docker stop todos-app-task-02 && docker rm todos-app-task-02
docker build --no-cache -t todos-app-task-03 -f task03/Dockerfile .
docker run -dp 3000:3000 --name todos-app-task-03 todos-app-task-03
docker stop todos-app-task-03 && docker rm todos-app-task-03
docker build --no-cache -t todos-app-task-04 -f task04/Dockerfile .
docker run -dp 3000:3000 --name todos-app-task-04 todos-app-task-04
docker stop todos-app-task-04 && docker rm todos-app-task-04
docker build --no-cache -t todos-app-task-05 -f task05/Dockerfile .
docker run -dp 3000:3000 --name todos-app-task-05 todos-app-task-05
docker stop todos-app-task-05 && docker rm todos-app-task-05
docker build --no-cache -t todos-app-task-06 -f task06/Dockerfile .
docker volume create todo-db
docker run -dp 3000:3000 --mount type=volume,src=todo-db,target=/etc/todos --name todos-app-task-06 todos-app-task-06
docker stop todos-app-task-06 && docker rm todos-app-task-06 && docker volume rm todo-db
Note
Change the MYSQL_PASSWORD to your own
cat << EOF > .env
MYSQL_HOST=mysql
MYSQL_USER=root
MYSQL_PASSWORD=<DBPassword>
MYSQL_DB=todos
EOF
docker-compose up -d
docker-compose down