"No command specified" from re-imported docker image/container

Solution 1:

docker export does not export everything about the container — just the filesystem. So, when importing the dump back into a new docker image, additional flags need to be specified to recreate the context.

For example, if the original container was running fine because the Dockerfile that was used for creating its image had CMD ["/usr/bin/supervisord"] in it, then import your dump this way:

docker import \
--change 'CMD ["/usr/bin/supervisord"]' \
path/to/dump.tar imagename:tagname

Solution 2:

you can use docker load command to load images from archive file . this command will import image file and args together.


Solution 3:

Got this error when trying to export and import docker microsoft/mssql-server-linux.

https://hub.docker.com/r/microsoft/mssql-server-linux/

Commands to export and import:

docker export --output "C:\Users\oscar\Desktop\sqlTestMS.tar" msSQL

docker import "C:\Users\oscar\Desktop\sqlTestMS.tar" mssql

However we could not find the command to run it. The solution was listing all containers on the exporting machine and looking at the command ran.

docker ps

enter image description here

From there we could find out how to run the correct command:

docker run --name msSQL -p 1401:1433 -d mssql:latest /opt/mssql/bin/sqlservr

Tags:

Docker