Some shortcuts for Docker
Here’s the table of contents:
- Show images and sizes
- Saving Docker image for import
- Mount volume for read and write function within container
- Copy file from and to container
- Delete image
- Commit changes to image
Show images and sizes
sudo docker image ls
Saving Docker image for import
docker export 'container_id' > docker_container.tar
docker import - importedcontainer < docker_container.tar
Mount volume for read and write function within container
sudo docker run -v /home/user/<path>:/<container path>
Copy file from and to container
docker cp src/. container_id:/target
docker cp container_id:/src/. target
Delete image
docker image rm
Commit changes to image
docker commit -m "Changed" image_name