Last active
October 28, 2019 10:39
-
-
Save saniyathossain/06f3d68bf6dc1755282904d661989425 to your computer and use it in GitHub Desktop.
Docker Toolbox Installation, Necessary Commands
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
For Docker Toolbox (below windows 10 professional): | |
download link: https://github.com/docker/toolbox/releases -> download exe file from v18.09.3 version (as far as i know there are some issues with latest version) | |
Steps: | |
## Docker Toolbox Environment Paths | |
DOCKER_CERT_PATH=C:\Users\username\.docker\machine\machines\default | |
DOCKER_HOST=tcp://192.168.99.100:2376 | |
DOCKER_MACHINE=D:\dev\docker-toolbox\docker-machine.exe | |
DOCKER_MACHINE_NAME=default | |
DOCKER_TLS_VERIFY=1 | |
DOCKER_TOOLBOX_INSTALL_PATH=D:\dev\docker-toolbox\ | |
HTTP_PROXY= | |
HTTPS_PROXY= | |
NO_PROXY=localhost,127.0.0.1,192.168.99.100 | |
1. Make folders, Add following environment variables in windows from control panel (Note: must change the proxy, paths accordingly). | |
2. Install Docker Toolbox, you might be prompted to install git and virtualbox, install both of them if not installed). | |
3. After installation, run Docker 'Quickstart Terminal' on desktop, wait until the terminal cursor comes (might take while). | |
4. Then run command -> docker run hello-world | |
5. Wait and docker will pull image from internet and success messeges will be shown. if that happens that means docker is running properly. | |
6. Mount desired volume. | |
1. command: docker-machine stop | |
2. wait | |
3. Open virtualbox. | |
4. open default settings | |
5. go to shared folder | |
6. add new share | |
7. inside that provide folder path (suppose in D:\ all your projects will reside) so write D:\ | |
8. in folder name write /app (it will be the path on virtual machine folder, slash is for root and app will the new folder) | |
9. check auto-mount | |
10. save, save. | |
11. command: docker-machine start | |
12. wait. | |
7. Some usefull commands: | |
1. suppose you copied your lv-base-app inside folder D:\docker in windows.(also rename and save .env files and check the configs and change accordingly) | |
2. command: docker-machine ssh | |
3. command: sudo su | |
4. command: cd /app/docker/lv-base-app/docker/web-app | |
5. command: docker build -t php:7.3.8-fpm -f web-app.Dockerfile . | |
here | |
build is for build image | |
-t is for tagging the image a name (after : character is the version number usually) | |
-f is for filename | |
. is for context (means this would the root folder for this image) | |
6. command: docker image ls -a | |
check the list of images | |
note: sometimes intermediate image builds with tag <none>. in order to remove them | |
command: docker image prune -f | |
7. command: cd .. then cd db | |
8. rename env | |
9. command: docker build -t mysql:8.0.17 -f db.Dockerfile . | |
10. command: docker image ls -a | |
now there should be two images, one for php nginx, one is for mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment