Ubuntu image won't start on Centos

Hello,

A few weeks ago I’ve created a customized docker Ubuntu (14.04) image with some ansible and Galaxy Roles.

The main idea was to share my ansible tools with others.
the image was built and exported on a Ubuntu machine.

One my collegues has a Centos 7 VM with docker
centos-release-7-5.1804.el7.centos.2.x86_64

docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:25 2017
OS/Arch: linux/amd64

Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 22:06:25 2017
OS/Arch: linux/amd64
Experimental: false

We’ve been able to import the image.

Creating the container using the “docker run -it --name ansiblecontainer -v /usr/playbooks:/playbooks -e TZ=“Europe/Paris” -u root 76619dba82ae”

will give me this type of output:

“docker: Error response from daemon: No command specified.”
I noticed the container was created after even with some error.
but It’s not possible To start the container : “docker start 60cf9ff092c7” will give me
“Error response from daemon: linux spec user: unable to find user root: no matching entries in passwd file
Error: failed to start containers: 60cf9ff092c7”

Please help,

Regards

If your image does not have a default command set to run on startup (in your Dockerfile) you have to provide one yourself on the command line. You could add ‘/bin/bash’ and try.

docker run -it --name ansiblecontainer -v /usr/playbooks:/playbooks -e TZ=“Europe/Paris” -u root 76619dba82ae /bin/bash

Hello sillydockerid,

Thanks for your reply, I tried the following command

“[root@xxxxxx ~]# docker run -it --name ansibletest -v /usr/playbooks:/playbooks -e TZ=“Europe/Paris” -u root 76619dba82ae /bin/bash”

It will give me the following error

"docker: Error response from daemon: linux spec user: unable to find user root: no matching entries in passwd file. "

and will create the docker container

[root@xxxxx ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5a91eeba4afd 76619dba82ae “/bin/bash” 7 seconds ago Created ansibletest

I’m not able to start the container.

Regards

Hi dbenny,

The/etc/passwd file in your image probably does not contain an entry for root. Did you modify that file in you image build?

Can you run this command:

docker run -it --name ansibletest -v /usr/playbooks:/playbooks -e TZ=“Europe/Paris” 76619dba82ae cat /etc/passwd

It will show you the contents of the /etc/passwd file in the image.

Hi sillydockerid,

I didn’t modify the file, the command will give the following

[root@server ~]# docker run -it --name ansibletest10 -v /usr/playbooks:/playbooks -e TZ=“Europe/Paris” 76619dba82ae cat /etc/passwd

docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused “exec: “cat”: executable file not found in $PATH”.

Regards

Can you run any of the below?
docker run -it 76619dba82ae /bin/bash
or
docker run -it 76619dba82ae /bin/sh

If all of the above fail can you perhaps share your Dockerfile?

Does the container run on your own machine?

When in the original post you say “export” and “import” the image…what commands, exactly, did you run on which machines?

Hello David,

I would generally use this type of command

docker export 7c5ab332c34d | /opt/test/ubuntu-pyez-final.tar

where 7c5ab332c34d is the container ID of the customized Ubuntu image.

I would import the image using

cat ubuntu-pyez-final.tar | docker import - ubuntu-pyez:new

Maybe I’m wrong on the method and I should do it again?

Thanks