Giter VIP home page Giter VIP logo

Comments (4)

AlexisLessard avatar AlexisLessard commented on June 24, 2024

The hostname ansible module uses a systemd strategy for Fedora, but uses a more custom one for Debian based modules (On a side note, My god, is the ansible source code beautiful or what? So easy to understand). Running bash inside the container, I receive the following output:

[root@Fedora /]# hostnamectl --transient set-hostname test
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to create bus connection: Host is down

Similar messages appear for other systemd commands. For instance, systemctl status gives the same message.
I'm gonna try to find what is causing this message, and how the image could be adapted to fix this.

from docker-fedora29-ansible.

AlexisLessard avatar AlexisLessard commented on June 24, 2024

Running the container with the following command (wich is shown in the README file), I get this:

docker run --detach --privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-fedora29-ansible:latest
docker exec -it hardcore_cori /bin/bash                                                          
[root@49212a090e69 /]# systemctl status
● 49212a090e69
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Sun 2019-06-09 22:28:53 UTC; 23s ago
   CGroup: /system.slice/containerd.service
           ├─init.scope
           │ └─1 /usr/sbin/init
           └─system.slice
             └─systemd-journald.service
               └─15 /usr/lib/systemd/systemd-journald

There was an issue with unmounted volumes. I will implement it inside molecule.

from docker-fedora29-ansible.

AlexisLessard avatar AlexisLessard commented on June 24, 2024

Visibly, the image wasn't starting using systemd with Molecule. I've modified my platform configuration like so:

  - name: Fedora
    image: geerlingguy/docker-fedora29-ansible
    pre_build_image: True
    privileged: True
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    command: /usr/sbin/init

Now the error message reads like so:

[root@Fedora /]# hostnamectl --transient set-hostname test
Failed to create bus connection: No such file or directory

Same thing happens on a vanilla image that I run on the command line. Time to find a more specific way to solve this. But I'm getting there, as simple commandes like systemctl status works.

from docker-fedora29-ansible.

AlexisLessard avatar AlexisLessard commented on June 24, 2024

Excerpt from the molecule documentation for the docker driver:

If specifying the CMD directive in your Dockerfile.j2 or consuming a built image which declares a CMD directive, then you must set override_command: False. Otherwise, Molecule takes care to honour the value of the command key or uses the default of bash -c "while true; do sleep 10000; done" to run the container until it is provisioned.

from docker-fedora29-ansible.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.