0

I have exported gitlab container and send it to another server as gitlab.tar file.

imported container with:

docker import gitlab.tar gitlab

docker images says:

gitlab              latest              432365b4f2fd        9 minutes ago       1.56GB

but when try to run image I got:

docker run -d 432365b4f2fd:

docker: Error response from daemon: No command specified.

also I tried docker run -d gitlab:latest

Edgaras Karka
  • 7,400
  • 15
  • 61
  • 115

1 Answers1

1

That's because export clears the history of the image so you docker container currently doesn't remember how it suppose to run. You have two solutions:

  • Check gitlab's dockerfile and use the command that is being used like below (I am not sure how much this solution would be efficient but it worked for me before with another image)

    docker run -d gitlab:latest /usr/local/bin/wrapper
    
  • Use docker save to save a tar file then use docker load to restore it on the new server.
    # To save an image
    docker save -o gitlab-latest.tar gitlab:latest
    # To load an image
    docker load --input gitlab-latest.tar
    
    For more docker save usage

Also you may check the following answer for more details

Mostafa Hussein
  • 11,063
  • 3
  • 36
  • 61