Testing with CentOS 6 docker image

299 views
Skip to first unread message

napolean....@gmail.com

unread,
Mar 4, 2018, 1:35:39 AM3/4/18
to molecule-users
Hello,

I am able to test my roles on a CentOS 7 docker image using:
platforms:
   - name: instance
     image: centos:7
     privileged: true
     volume_mounts:
       - /sys/fs/cgroup:/host/sys/fs/cgroup:ro
     command: "/usr/sbin/init"
     capabilities:
       - SYS_ADMIN

However, I am unable to test on a CentOS:6 image:
platforms:
  - name: instance6
    image: centos:6
    privileged: true
    volume_mounts:
      - /sys/fs/cgroup:/host/sys/fs/cgroup:ro
    command: "/usr/sbin/init"
    capabilities:
      - SYS_ADMIN

When I run molecule test, I get this:

        "msg": "Error starting container b4f534a257730ed8312b3c26c2556b729e6b413ffd5096a7c928480768238c58: 400 Client Error: Bad Request (\"{\"message\":\"OCI runtime create failed: container_linux.go:348: starting container process caused \\\"exec: \\\\\\\"/usr/sbin/init\\\\\\\": stat /usr/sbin/init: no such file or directory\\\": unknown\"}\")"

How can I test using a centos6 docker image?

Werner Dijkerman

unread,
Mar 25, 2018, 8:55:43 AM3/25/18
to molecule-users
I haven't used CentOS 6 before in a container, but do you really need the "command", "capabilities" and the "volume_mounts" for CentOS 6? I believe these are normally needed for systemd when using CentOS 7, but not for CentOS 6?

Op zondag 4 maart 2018 07:35:39 UTC+1 schreef Sudheera Satyanarayana:

jde...@gmail.com

unread,
Apr 6, 2018, 1:31:56 PM4/6/18
to molecule-users
Yeah, I haven't tested Molecule on CentOS 6, and CentOS 6 is ancient.  I suggest something more modern for something of this nature.

Tom Hodder

unread,
Apr 7, 2018, 12:07:41 AM4/7/18
to molecule-users


        "msg": "Error starting container b4f534a257730ed8312b3c26c2556b729e6b413ffd5096a7c928480768238c58: 400 Client Error: Bad Request (\"{\"message\":\"OCI runtime create failed: container_linux.go:348: starting container process caused \\\"exec: \\\\\\\"/usr/sbin/init\\\\\\\": stat /usr/sbin/init: no such file or directory\\\": unknown\"}\")"

How can I test using a centos6 docker image?

I've switched over to using the bento vagrant boxes with the vagrant driver as running docker with "privileged: true" and containers with systemd seems to randomly crash systemd on my local/host machine.

I am wondering about running docker engine inside a virtualbox instance or something like that...



thoralfg...@gmail.com

unread,
Jul 9, 2018, 3:10:55 PM7/9/18
to molecule-users
FYI Removing `command: /sbin/init` for centos:6 worked for my tests.
Reply all
Reply to author
Forward
0 new messages