Docker commit and export latest version of container
Quote from Moshe Sharon on 21/02/2021, 5:35 pmProblem
User wants to save latest changes and move container to a different machine
Solution
sudo docker commit –change “Latest Version to export” container-name container-name:v2
sudo docker save container-name:v2 > container-name.tar
Problem
User wants to save latest changes and move container to a different machine
Solution
sudo docker commit –change “Latest Version to export” container-name container-name:v2
sudo docker save container-name:v2 > container-name.tar
Quote from Moshe Sharon on 21/02/2021, 5:45 pmAttached scripts to export containers and assigned volumes
Solution
edit docker-export.sh and change the following parameters
# Container name to export
NAME=container-name
# Username of the remote host to copy
USER=username
# Host to copy the exported container
HOST=newhost
# New version for the container
VERSION=2run the following command
./docker-export.sh export
Attached scripts to export containers and assigned volumes
Solution
edit docker-export.sh and change the following parameters
# Container name to export
NAME=container-name
# Username of the remote host to copy
USER=username
# Host to copy the exported container
HOST=newhost
# New version for the container
VERSION=2
run the following command
./docker-export.sh export
Uploaded files: