You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
Customizing a OS image with a RUN step that interacts with systemctl works similarly as it works if executed at container time
Current Behavior
Systemctl interactions fail.
Context
I'm using Footloose as base infra for running platform tests through this Gradle plugin. One of my tests require deploying an application using an orchestration scheduler called Replicated. The scheduler installation script has this block:
detectInitSystem() {
if [[ "$(/sbin/init --version 2>/dev/null)" =~ upstart ]]; then
INIT_SYSTEM=upstart
elif [[ "$(systemctl 2>/dev/null)" =~ -\.mount ]]; then
INIT_SYSTEM=systemd
elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
INIT_SYSTEM=sysvinit
else
echo >&2 "Error: failed to detect init system or unsupported."
exit 1
fi
}
By doing this:
FROM quay.io/footloose/ubuntu16.04
# Pre-seed Replicated
RUN curl -sSL https://get.replicated.com/docker?replicated_tag=2.51.0 | sudo bash -s bypass-storagedriver-warnings ui-bind-port=8888 no-public-address no-proxy
I'm getting Error: failed to detect init system or unsupported.
However, if I execute curl -sSL https://get.replicated.com/docker?replicated_tag=2.51.0 | sudo bash -s bypass-storagedriver-warnings ui-bind-port=8888 no-public-address no-proxy in a cluster-node0 container created based on footloose/ubuntu16.04 it works nicely.
Steps to Reproduce
Dockerfile
FROM quay.io/footloose/ubuntu16.04
RUN systemctl
Build Docker image
docker build -t footloose-replicated:test .
[+] Building 0.4s (5/6)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 279B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for quay.io/footloose/ubuntu16.04:latest 0.0s
=> CACHED [1/3] FROM quay.io/footloose/ubuntu16.04 0.0s
=> ERROR [2/3] RUN systemctl 0.3s
------
> [2/3] RUN systemctl:
#5 0.270 Failed to connect to bus: No such file or directory
------
executor failed running [/bin/sh -c systemctl]: exit code: 1
docker exec -it cluster-node0 bash
root@node0:/# systemctl
UNIT LOAD ACTIVE SUB DESCRIPTION
dev-vda1.device loaded activating tentative /dev/vda1
-.mount loaded active mounted /
...
Notes
I've also tried this with other OS that doesn't require privileged mode without luck. This might be a limitation of what you can do on the RUN step of Dockerfile, but if that's the case, it should be great to document this in the customize OS example.
The text was updated successfully, but these errors were encountered:
Just food for thought, and I should say that I haven't reviewed replicated's script, however you are executing it in an environment where systemd is not running yet.
This is a guess, but I think this script assumes a running system. And a docker build is not that.
I would try to start your cluster and customize by hand or with Ansible.
If you're trying to save time then see if you can export that running VM and re-run it.
Just a wild guess, but maybe try to tag the resulting container, etc. like you would with a (regular) Docker container (if you wouldn't do it in a Dockerfile).
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
Customizing a OS image with a RUN step that interacts with systemctl works similarly as it works if executed at container time
Current Behavior
Systemctl interactions fail.
Context
I'm using Footloose as base infra for running platform tests through this Gradle plugin. One of my tests require deploying an application using an orchestration scheduler called Replicated. The scheduler installation script has this block:
By doing this:
I'm getting
Error: failed to detect init system or unsupported.
However, if I execute
curl -sSL https://get.replicated.com/docker?replicated_tag=2.51.0 | sudo bash -s bypass-storagedriver-warnings ui-bind-port=8888 no-public-address no-proxy
in acluster-node0
container created based onfootloose/ubuntu16.04
it works nicely.Steps to Reproduce
Dockerfile
Build Docker image
vs
footloose create
based onNotes
I've also tried this with other OS that doesn't require privileged mode without luck. This might be a limitation of what you can do on the RUN step of Dockerfile, but if that's the case, it should be great to document this in the customize OS example.
The text was updated successfully, but these errors were encountered: