Running on Docker for MAC

You are using UBOS on a platform that does not have its own forum.
Post Reply
anyball
Posts: 3
Joined: Tue Sep 01, 2020 1:00 am

Running on Docker for MAC

Post by anyball »

Hi, I am trying to run UBOS on a docker container on my mac, and I receive the following error:

[FATAL tini (7)] exec /bin/init failed: No such file or directory

If I start the container using /bin/bash, it appears to run, but then any systemctl command report the following error:

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

I am running the docker run command as on the getting started section:

docker run -i -t --cap-add NET_ADMIN --cap-add NET_BIND_SERVICE
--cap-add NET_BROADCAST --cap-add NET_RAW --cap-add SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro
-e container=docker ubos/ubos-yellow /bin/init

Am I doing something wrong?



j12t
Posts: 167
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

Re: Running on Docker for MAC

Post by j12t »

You found a bug in the documentation. Sorry about that.

Instead of main executable

Code: Select all

/bin/init
at the very end of the command, we need to run systemd:

Code: Select all

/usr/lib/systemd/systemd
as UBOS doesn't ship with SysV init scripts any more.

Filed here: https://github.com/uboslinux/ubos-docs/issues/92.

Please report back if you still have trouble.

anyball
Posts: 3
Joined: Tue Sep 01, 2020 1:00 am

Re: Running on Docker for MAC

Post by anyball »

Hi, now I receive this error:

Trying to run as user instance, but the system has not been booted with systemd.

j12t
Posts: 167
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

Re: Running on Docker for MAC

Post by j12t »

I don't know what that is. Just tried on my Mac, and while there are a few warnings during boot, they seem harmless. Here is my transcript:

Code: Select all

$ docker run -i -t --cap-add NET_ADMIN --cap-add NET_BIND_SERVICE --cap-add NET_BROADCAST --cap-add NET_RAW --cap-add SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker ubos/ubos-yellow /usr/lib/systemd/systemd
Unable to find image 'ubos/ubos-yellow:latest' locally
latest: Pulling from ubos/ubos-yellow
b12b9d3a3b2d: Pull complete 
Digest: sha256:5ec5c6c6fe31f261b79acbbd1e55eb700dd5c8ba0ece0cb0044fe6212058d32a
Status: Downloaded newer image for ubos/ubos-yellow:latest
systemd 243.51-1-arch running in system mode. (+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.
Failed to create symlink /sys/fs/cgroup/net_prio: File exists
Failed to create symlink /sys/fs/cgroup/net_cls: File exists
Failed to create symlink /sys/fs/cgroup/cpu: File exists
Failed to create symlink /sys/fs/cgroup/cpuacct: File exists

Welcome to UBOS!

Set hostname to <f190600c17af>.
Initializing machine ID from random generator.
system-getty.slice: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
(This warning is only shown for the first unit using IP firewalling.)
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Device-mapper event daemon FIFOs.
[  OK  ] Listening on Process Core Dump Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on Network Service Netlink Socket.
         Mounting Huge Pages File System...
         Mounting Temporary Directory (/tmp)...
Failed to set devices.allow on /docker/f190600c17af71fe5719ebf4875e87b67ec4fb034b862e03cd2d699d3fcc1b43/system.slice/systemd-journald.service: Operation not permitted
         Starting Journal Service...
         Mounting FUSE Control File System...
         Starting Remount Root and Kernel File Systems...
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted Temporary Directory (/tmp).
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Started Remount Root and Kernel File Systems.
         Starting Create System Users...
[  OK  ] Started Create System Users.
         Starting Create Static Device Nodes in /dev...
[  OK  ] Started Create Static Device Nodes in /dev.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Rebuild Dynamic Linker Cache...
[  OK  ] Started Rebuild Dynamic Linker Cache.
[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[  OK  ] Started Flush Journal to Persistent Storage.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Rebuild Journal Catalog...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Rebuild Journal Catalog.
         Starting Update is Completed...
[  OK  ] Started Update is Completed.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily renewal of Let's Encrypt's certificates.
[  OK  ] Started Daily rotation of log files.
[  OK  ] Started Daily verification of password and group files.
[  OK  ] Started Daily Cleanup of Snapper Snapshots.
[  OK  ] Started Timeline of Snapper Snapshots.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started Periodic Command Scheduler.
[  OK  ] Started D-Bus System Message Bus.
         Starting IPv4 Packet Filtering Framework...
         Starting SSH Key Generation...
         Starting Login Service...
         Starting ubos-admin configuration...
[  OK  ] Started IPv4 Packet Filtering Framework.
         Starting IPv6 Packet Filtering Framework...
[  OK  ] Started IPv6 Packet Filtering Framework.
[  OK  ] Reached target Network (Pre).
         Starting Network Service...
[  OK  ] Started SSH Key Generation.
[  OK  ] Started Network Service.
         Starting Network Name Resolution...
[  OK  ] Started Login Service.
[  OK  ] Started Network Name Resolution.
[  OK  ] Reached target Network.
[  OK  ] Reached target Host and Network Name Lookups.
[  OK  ] Started OpenSSH Daemon.
         Starting Permit User Sessions...
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Console Getty.
[  OK  ] Reached target Login Prompts.


+--------------------------------------------------------------------------+
|                                                                          |
|                           Welcome to UBOS (R)                            |
|                                                                          |
|                                ubos.net                                  |
|                                                                          |
|                                 device class: container, channel: yellow |
+--------------------------------------------------------------------------+

Note: run 'sudo ubos-admin update' to get the latest version.
      and: frequent backups with 'sudo ubos-admin backup' are recommended.

f190600c17af login: root
[root@f190600c17af ~]# ubos-admin listsites

anyball
Posts: 3
Joined: Tue Sep 01, 2020 1:00 am

Re: Running on Docker for MAC

Post by anyball »

I just copy the command from your transcript, and this is the result:

Code: Select all

$ docker run -i -t --cap-add NET_ADMIN --cap-add NET_BIND_SERVICE --cap-add NET_BROADCAST --cap-add NET_RAW --cap-add SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker ubos/ubos-yellow /usr/lib/systemd/systemd
Unable to find image 'ubos/ubos-yellow:latest' locally
latest: Pulling from ubos/ubos-yellow
b12b9d3a3b2d: Pull complete 
Digest: sha256:5ec5c6c6fe31f261b79acbbd1e55eb700dd5c8ba0ece0cb0044fe6212058d32a
Status: Downloaded newer image for ubos/ubos-yellow:latest
Trying to run as user instance, but the system has not been booted with systemd.
$
I guess has something to do with my osx configuration, I am running mojave by the way... and

I guess I'll try the a different option than ubos for now...

Thank you very much anyway :)

Post Reply