Docker post.
-
-
Save davilera/18dd6532b9046d77f1597720261e5721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install docker.io docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo usermod -aG docker your-user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run [OPTIONS] IMAGE [COMMAND] [ARG...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run hello-world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unable to find image 'hello-world:latest' locally | |
latest: Pulling from library/hello-world | |
d1725b59e92d: Pull complete | |
Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788 | |
Status: Downloaded newer image for hello-world:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello from Docker! | |
This message shows that your installation appears to be working correctly. | |
To generate this message, Docker took the following steps: | |
1. The Docker client contacted the Docker daemon. | |
2. The Docker daemon pulled the "hello-world" image from the Docker Hub. | |
(amd64) | |
3. The Docker daemon created a new container from that image which runs the | |
executable that produces the output you are currently reading. | |
4. The Docker daemon streamed that output to the Docker client, which sent it | |
to your terminal. | |
To try something more ambitious, you can run an Ubuntu container with: | |
$ docker run -it ubuntu bash | |
Share images, automate workflows, and more with a free Docker ID: | |
https://hub.docker.com/ | |
For more examples and ideas, visit: | |
https://docs.docker.com/get-started/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
53592cd94a6d hello-world "/hello" 2 seconds ago Exited (0) 2 seconds ago determined_feynman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker rm 53592cd94a6d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mysql: | |
image: mysql:5.7 | |
restart: always | |
ports: | |
- 8081:3306 | |
environment: | |
MYSQL_USER: wordpress | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_PASSWORD: wordpress | |
wordpress: | |
depends_on: | |
- mysql | |
image: wordpress | |
ports: | |
- 8080:80 | |
restart: always | |
environment: | |
WORDPRESS_DB_HOST: mysql:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-compose stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mysql: | |
image: mysql:5.7 | |
restart: always | |
ports: | |
- 8081:3306 | |
environment: | |
MYSQL_USER: wordpress | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_PASSWORD: wordpress | |
wordpress: | |
depends_on: | |
- mysql | |
image: wordpress | |
ports: | |
- 8080:80 | |
restart: always | |
volumes: | |
- ./:/var/www/html/wp-content/plugins/nelio-content | |
environment: | |
WORDPRESS_DB_HOST: mysql:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 localhost | |
127.0.0.1 content.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nginx-proxy: | |
image: jwilder/nginx-proxy | |
restart: always | |
ports: | |
- 80:80 | |
- 3306:3306 | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro | |
networks: | |
default: | |
external: | |
name: proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
mysql: | |
image: mysql:5.7 | |
restart: always | |
ports: | |
- 8081:3306 | |
environment: | |
MYSQL_USER: wordpress | |
MYSQL_ROOT_PASSWORD: wordpress | |
MYSQL_DATABASE: wordpress | |
MYSQL_PASSWORD: wordpress | |
networks: | |
- backend | |
wordpress: | |
depends_on: | |
- mysql | |
image: wordpress | |
ports: | |
- 8080:80 | |
restart: always | |
volumes: | |
- ./:/var/www/html/wp-content/plugins/nelio-content | |
environment: | |
VIRTUAL_HOST: content.local | |
VIRTUAL_PORT: 8080 | |
WORDPRESS_DB_HOST: mysql:3306 | |
WORDPRESS_DB_USER: wordpress | |
WORDPRESS_DB_PASSWORD: wordpress | |
networks: | |
- frontend | |
- backend | |
networks: | |
backend: | |
frontend: | |
external: | |
name: proxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment