|
|
@@ -52,17 +52,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
- [download alpine linux](https://alpinelinux.org/downloads/)
|
|
|
|
- [download alpine linux](https://alpinelinux.org/downloads/)
|
|
|
|
- [dockerhub alpine image](https://hub.docker.com/_/alpine)
|
|
|
|
- [dockerhub alpine image](https://hub.docker.com/_/alpine)
|
|
|
|
|
|
|
|
- [run without sudo on linux](https://docs.docker.com/engine/install/linux-postinstall/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### docker :
|
|
|
|
- [docker starter guide](https://docs.docker.com/get-started/)
|
|
|
|
- [docker starter guide](https://docs.docker.com/get-started/)
|
|
|
|
- [docker glossaire](https://docs.docker.com/glossary/)
|
|
|
|
- [docker glossaire](https://docs.docker.com/glossary/)
|
|
|
|
- [Dockerfile syntaxe](https://docs.docker.com/engine/reference/builder/)
|
|
|
|
- [Dockerfile syntaxe](https://docs.docker.com/engine/reference/builder/)
|
|
|
|
- [determine the parent image](https://forums.docker.com/t/determine-the-parent-image/48611)
|
|
|
|
- [determine the parent image](https://forums.docker.com/t/determine-the-parent-image/48611)
|
|
|
|
- [docker image from scratch](https://codeburst.io/docker-from-scratch-2a84552470c8)
|
|
|
|
- [docker image from scratch](https://codeburst.io/docker-from-scratch-2a84552470c8)
|
|
|
|
- [build context and image context](https://stackoverflow.com/questions/55108649/what-is-app-working-directory-for-a-dockerfile/55109065#55109065)
|
|
|
|
- [build context and image context](https://stackoverflow.com/questions/55108649/what-is-app-working-directory-for-a-dockerfile/55109065#55109065)
|
|
|
|
- [nginx begginer guide](https://hub.docker.com/_/nginx/)
|
|
|
|
|
|
|
|
- [nginx all directives for conf file](https://nginx.org/en/docs/dirindex.html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### docker pid 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**docker pid 1**
|
|
|
|
- nginx by default will create some child process (a master and some workers), then it quits (doc ?)
|
|
|
|
- nginx by default will create some child process (a master and some workers), then it quits (doc ?)
|
|
|
|
- when the first process of a docker container exit, the container exit (doc ?)
|
|
|
|
- when the first process of a docker container exit, the container exit (doc ?)
|
|
|
|
- so we must tell nginx to not go background : "-g 'daemon off'"
|
|
|
|
- so we must tell nginx to not go background : "-g 'daemon off'"
|
|
|
@@ -73,44 +73,45 @@
|
|
|
|
- "When PID 1 exits, the container will exit" (where is says in the doc ?)
|
|
|
|
- "When PID 1 exits, the container will exit" (where is says in the doc ?)
|
|
|
|
- ["By design, containers started in detached mode exit when the root process used to run the container exits"](https://docs.docker.com/engine/reference/run/#detached--d)
|
|
|
|
- ["By design, containers started in detached mode exit when the root process used to run the container exits"](https://docs.docker.com/engine/reference/run/#detached--d)
|
|
|
|
|
|
|
|
|
|
|
|
#### install and use docker and compose
|
|
|
|
**install and use docker and compose**
|
|
|
|
|
|
|
|
|
|
|
|
- [how to install docker engine](https://docs.docker.com/engine/install/ubuntu/)
|
|
|
|
- [how to install docker engine](https://docs.docker.com/engine/install/ubuntu/)
|
|
|
|
- [github releases](https://github.com/docker/compose/releases)
|
|
|
|
- [github releases](https://github.com/docker/compose/releases)
|
|
|
|
- [install last version of compose manually](https://docs.docker.com/compose/install/compose-plugin/#install-the-plugin-manually)
|
|
|
|
- [install last version of compose manually](https://docs.docker.com/compose/install/compose-plugin/#install-the-plugin-manually)
|
|
|
|
- [install manually SO discussion](https://stackoverflow.com/questions/57456212/error-version-in-docker-compose-yml-is-unsupported)
|
|
|
|
- [install manually SO discussion](https://stackoverflow.com/questions/57456212/error-version-in-docker-compose-yml-is-unsupported)
|
|
|
|
- [correct release version name for download with a 'v'](https://stackoverflow.com/questions/58747879/docker-compose-usr-local-bin-docker-compose-line-1-not-command-not-found)
|
|
|
|
- [correct release version name for download with a 'v'](https://stackoverflow.com/questions/58747879/docker-compose-usr-local-bin-docker-compose-line-1-not-command-not-found)
|
|
|
|
- the version installed with apt is 1.17.1, way out of date
|
|
|
|
- the version installed with apt is 1.17.1, way out of date
|
|
|
|
|
|
|
|
- **remove old versions**
|
|
|
|
**remove old versions**
|
|
|
|
|
|
|
|
- `sudo apt remove docker docker-engine docker.io containerd runc`
|
|
|
|
- `sudo apt remove docker docker-engine docker.io containerd runc`
|
|
|
|
**preparing directory**
|
|
|
|
- **preparing directory**
|
|
|
|
- `sudo apt update`
|
|
|
|
- `sudo apt update`
|
|
|
|
- `sudo apt install ca-certificates curl gnupg lsb-release`
|
|
|
|
- `sudo apt install ca-certificates curl gnupg lsb-release`
|
|
|
|
- `sudo mkdir -p /etc/apt/keyrings`
|
|
|
|
- `sudo mkdir -p /etc/apt/keyrings`
|
|
|
|
- `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg`
|
|
|
|
- `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg`
|
|
|
|
- `echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null`
|
|
|
|
- `echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null`
|
|
|
|
**installing docker engine**
|
|
|
|
- **installing docker engine**
|
|
|
|
- `sudo apt update`
|
|
|
|
- `sudo apt update`
|
|
|
|
- `sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin`
|
|
|
|
- `sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin`
|
|
|
|
**check if installation worked**
|
|
|
|
- **check if installation worked**
|
|
|
|
- `sudo docker run hello-world`
|
|
|
|
- `sudo docker run hello-world`
|
|
|
|
**installing docker compose** checked version on github release, see above
|
|
|
|
- **installing docker compose** checked version on github release, see above
|
|
|
|
- notice the 'v' below, before the version name (docker doc has it wong)
|
|
|
|
- notice the 'v' below, before the version name (docker doc has it wong)
|
|
|
|
- `sudo curl -L "https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose`
|
|
|
|
- `sudo curl -L "https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose`
|
|
|
|
- `sudo chmod +x /usr/local/bin/docker-compose`
|
|
|
|
- `sudo chmod +x /usr/local/bin/docker-compose`
|
|
|
|
|
|
|
|
**volumes vs bind mounts :**
|
|
|
|
#### volumes vs bind mounts
|
|
|
|
- [docker doc: use volumes](https://docs.docker.com/storage/volumes/)
|
|
|
|
|
|
|
|
- [docker doc: use bind mounts](https://docs.docker.com/storage/bind-mounts/)
|
|
|
|
* [docker doc: use volumes](https://docs.docker.com/storage/volumes/)
|
|
|
|
- [comparison volume vs bind mounts](https://devopscook.com/docker-volumes-vs-bind-mounts/)
|
|
|
|
* [docker doc: use bind mounts](https://docs.docker.com/storage/bind-mounts/)
|
|
|
|
- [fundamentals use of volumes and bind mounts](https://medium.com/dlt-labs-publication/bind-mounts-volumes-in-docker-81523303cbb4)
|
|
|
|
* [comparison volume vs bind mounts](https://devopscook.com/docker-volumes-vs-bind-mounts/)
|
|
|
|
- [how volumes and bind mounts are really differents](https://serverfault.com/questions/996785/docker-volumes-vs-mount-binds-what-are-the-use-cases)
|
|
|
|
* [fundamentals use of volumes and bind mounts](https://medium.com/dlt-labs-publication/bind-mounts-volumes-in-docker-81523303cbb4)
|
|
|
|
|
|
|
|
* [how volumes and bind mounts are really differents](https://serverfault.com/questions/996785/docker-volumes-vs-mount-binds-what-are-the-use-cases)
|
|
|
|
|
|
|
|
- bind mounts are normal files anywhere on the computer, that docker container can access with absolut path and modify. They can also be modified without docker, since they are juste files
|
|
|
|
- bind mounts are normal files anywhere on the computer, that docker container can access with absolut path and modify. They can also be modified without docker, since they are juste files
|
|
|
|
- volumes are only modifiable by docker, they don't need an absolut path, and they are not dependent of host architecture
|
|
|
|
- volumes are only modifiable by docker, they don't need an absolut path, and they are not dependent of host architecture
|
|
|
|
|
|
|
|
|
|
|
|
#### tips
|
|
|
|
#### nginx
|
|
|
|
|
|
|
|
- [nginx begginer guide](https://hub.docker.com/_/nginx/)
|
|
|
|
|
|
|
|
- [nginx all directives for conf file](https://nginx.org/en/docs/dirindex.html)
|
|
|
|
|
|
|
|
|
|
|
|
[run without sudo on linux](https://docs.docker.com/engine/install/linux-postinstall/)
|
|
|
|
#### openssl
|
|
|
|
|
|
|
|
- [openssl faq](https://www.openssl.org/docs/faq.html)
|
|
|
|
|
|
|
|
- [openssl req man](https://www.openssl.org/docs/man1.0.2/man1/openssl-req.html)
|
|
|
|
|
|
|
|
- [SO discussion about ssl self signed certificate and becoming a CA](https://stackoverflow.com/questions/10175812/how-to-generate-a-self-signed-ssl-certificate-using-openssl)
|
|
|
|
|
|
|
|
|
|
|
|