Skip to content

Instantly share code, notes, and snippets.

@aonurdemir
Last active July 6, 2020 22:14
Show Gist options
  • Select an option

  • Save aonurdemir/50784d09b05e75539b263f2638768fe0 to your computer and use it in GitHub Desktop.

Select an option

Save aonurdemir/50784d09b05e75539b263f2638768fe0 to your computer and use it in GitHub Desktop.
Docker image manipulations
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