Last active
July 6, 2020 22:14
-
-
Save aonurdemir/50784d09b05e75539b263f2638768fe0 to your computer and use it in GitHub Desktop.
Docker image manipulations
This file contains hidden or 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
| http://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html | |
| precondition: docker should be installed and you should be logged in in your system. | |
| precondition2: use .dockerignore file near the Dockerfile as: | |
| * | |
| !Dockerfile | |
| in the folder where Docker file resides, run: | |
| docker build . | |
| find your image id by: | |
| docker images | |
| After finding image id run | |
| docker tag bd95ec6acc37 aonurdemir/php-fpm-7.2 | |
| docker push aonurdemir/php-fpm-7.2 | |
| docker run -d --name nginx -p 80:80 aonurdemir/php-fpm-7.2 | |
| #for saving updated container as image | |
| docker commit nginx newnginx | |
| #copy files | |
| docker cp <file_path> <container_id>:/<file_path> | |
| #get shell | |
| docker exec -it <container_name> bin/bash | |
| #run image as container | |
| docker run -dt --name <container_name> <image_tag> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment