Created
April 13, 2020 06:46
-
-
Save junaidulqayyumqureshi/6da6c010a50677f44af3b4622a2172ea to your computer and use it in GitHub Desktop.
Docker
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 |
Source
https://www.youtube.com/watch?v=bDB4IfJ31HY
Search for image from CLI
docker search --filter=stars=680 mysql
WHERE --filter-starts means only those entries which have n starts or more
Source
https://www.youtube.com/watch?v=HUpIoF_conA
Docker Compose
Tool for defining multi-container structured docker
Check docker version
docker-compose -v
Filename: docker-compose.yml
Bash into nginx:
docker exec -it container_name /bin/bash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source
https://www.youtube.com/watch?v=Kyx2PsuwomE
Installing Nginx
docker run -it -p 3031:80 nginx
3031:80 means that 3031 port which is on this system, map it to port on which service will listen, which is 80
Installing Apache Httpd
docker pull httpd
OR
docker run -d -p 3032:80 --name apacheserver httpd
Installing MySQL
docker run -d -p 3306:3306 --name mySql-db --env MYSQL_ROOT_PASSWORD=123456 mysql
Environment variables i.e. MYSQL_ROOT_PASSWORD can be seen in https://hub.docker.com/_/mysql on docker hub
Bind Mount
docker run -d -p 3031:80 -v D:\Tutorials\Docker\website:/usr/share/nginx/html --name nginx-website nginx
Source
https://www.youtube.com/watch?time_continue=209&v=jTeDNXLFYjE&feature=emb_logo
After the path is linked, create a new index.html file, to override the image directory index.html file which is located in /usr/share/nginx/html
Dockerfile
Build docker image
Push image to your repository on hub.docker
docker push juniallomate/nginx-website
In case of Access Denied Error
docker login