# Docker image doesn't work

**URL:** https://syncloud.discourse.group/t/docker-image-doesnt-work/84
**Category:** Configuration and Setup
**Created:** [22 July 2021 15:18 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84 "2021-07-22T15:18:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [22 July 2021 15:18 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/1 "2021-07-22T15:18:28Z")

</div>

I’m trying to run syncloud from Docker, as described on [github](https://github.com/syncloud/platform/wiki/Docker)

```auto
docker run \
  --restart=always \
  --name=syncloud \
  --volume=/var/lib/syncloud:/opt/disk/internal \
  --privileged \
  --detach=true \
  --publish=443:443 \
  --publish=80:80 \
  syncloud/platform-amd64

```

the container seems to be running, but there’s nothing in logs. No service is listening on any exposed port.

```auto
systemd-journald[22]: Received request to flush runtime journal from PID 1
snapd[2095736]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
snapd[2095736]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
snapd[2095736]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
snapd[2095736]: udevmon.go:149: udev event error: Unable to parse uevent, err: cannot parse libudev event: invalid env data
systemd-logind[1149]: Watching system buttons on /dev/input/event1 (Power Button)
systemd-udevd[2100778]: sda: /etc/udev/rules.d/60-ssd-scheduler.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/queue/scheduler}, ignoring: Invalid argument
systemd-logind[1149]: Watching system buttons on /dev/input/event0 (Power Button)
systemd-udevd[2100590]: sdd: /etc/udev/rules.d/60-ssd-scheduler.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sdd/queue/scheduler}, ignoring: Invalid argument
kernel: kvm: disabled by bios
systemd-udevd[2100769]: sdb: /etc/udev/rules.d/60-ssd-scheduler.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/queue/scheduler}, ignoring: Invalid argument
kernel: kvm: disabled by bios
systemd-udevd[2100751]: sdc: /etc/udev/rules.d/60-ssd-scheduler.rules:1 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sdc/queue/scheduler}, ignoring: Invalid argument
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
ntpd[2657]: Listen normally on 43 docker0 172.17.0.1:123
ntpd[2657]: Listen normally on 44 docker0 [fe80::42:2aff:fe10:d91c%3]:123
ntpd[2657]: bind(29) AF_INET6 fe80::7480:94ff:fe3b:9742%33#123 flags 0x11 failed: Cannot assign requested address
ntpd[2657]: unable to create socket on veth3d142e1 (45) for fe80::7480:94ff:fe3b:9742%33#123
ntpd[2657]: failed to init interface for address fe80::7480:94ff:fe3b:9742%33
ntpd[2657]: new interface(s) found: waking up resolver
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios
kernel: kvm: disabled by bios

```

is docker still supported or do I have to install syncloud on raw device? The OS is Ubuntu 20.04.2, docker version `20.10.7`

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [23 July 2021 10:27 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/2 "2021-07-23T10:27:06Z")

</div>

You should be able to.  
Do you have any other container listening on the same ports?  
Can you paste the output of `docker ps`?  
It may take few minutes to start the whole system inside the container depending on your resources.  
Also are you on a VM or a physical box?

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [23 July 2021 12:17 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/3 "2021-07-23T12:17:24Z")

</div>

No, there’s no port conflict.

Funny, now it seems to be running, I was probably too impatient. I was confused by empty docker logs. It might be helpful to mount `/var/snap/platform/common/log` to the host machine. Or probably the whole `/var/snap/platform` directory should uses as volume in order to persist data between Docker container restarts?

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [23 July 2021 12:28 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/4 "2021-07-23T12:28:02Z")

</div>

Though, I’ve switched to different Docker image. I’ve tried using `syncloud/platform-buster-amd64`

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [23 July 2021 12:44 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/5 "2021-07-23T12:44:58Z")

</div>

Docker image is used in our automated testing pipeline so it is guaranteed to be functioning correctly. As a result we gave it out as one of the ways of using Syncloud, but this is not our goal, it is just a result of a flexible build system we are using.

If you know what are you doing feel free to tweak and even propose changes to the documentation.

Our main goal is to help people who never heard of docker/linux and just want to keep their data off the cloud.

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [25 July 2021 09:12 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/6 "2021-07-25T09:12:37Z")

</div>

I believe in my case one of the problems is `/etc/fstab`

```auto
root@6d295c4bd55c:/# cat /etc/fstab 
/dev/sda2 / ext4 errors=remount-ro 0 1
/dev/sda1 none swap sw 0 0

```

this creates unnecessary timeouts during startup:

```auto
Jul 24 08:31:45 947afe9be92f systemd[1]: dev-sda1.device: Job dev-sda1.device/start timed out.
Jul 24 08:31:45 947afe9be92f systemd[1]: Timed out waiting for device /dev/sda1.
Jul 24 08:31:45 947afe9be92f systemd[1]: Dependency failed for /dev/sda1.
Jul 24 08:31:45 947afe9be92f systemd[1]: Dependency failed for Swap.
Jul 24 08:31:45 947afe9be92f systemd[1]: swap.target: Job swap.target/start failed with result 'dependency'.
Jul 24 08:31:45 947afe9be92f systemd[1]: dev-sda1.swap: Job dev-sda1.swap/start failed with result 'dependency'.
Jul 24 08:31:45 947afe9be92f systemd[1]: dev-sda1.device: Job dev-sda1.device/start failed with result 'timeout'.
Jul 24 08:31:45 947afe9be92f systemd[1]: Reached target System Initialization.

```

Also some systemd units are invalid, like (missing `getty@.service` file)

```auto
root@0d1f7ae83971:/# ls -laF /lib/systemd/system/autovt@.service
lrwxrwxrwx 1 root root 14 Oct 24 2020 '/lib/systemd/system/autovt@.service' -> 'getty@.service'

```

Then there’s timeout on network:

```auto
Jul 25 09:03:03 a5151bd4c55c systemd[1]: sys-subsystem-net-devices-eth0.device: Job sys-subsystem-net-devices-eth0.device/start timed out.
Jul 25 09:03:03 a5151bd4c55c systemd[1]: Timed out waiting for device /sys/subsystem/net/devices/eth0.
Jul 25 09:03:03 a5151bd4c55c systemd[1]: Dependency failed for ifup for eth0.
Jul 25 09:03:03 a5151bd4c55c systemd[1]: ifup@eth0.service: Job ifup@eth0.service/start failed with result 'dependency'.
Jul 25 09:03:03 a5151bd4c55c systemd[1]: sys-subsystem-net-devices-eth0.device: Job sys-subsystem-net-devices-eth0.device/start failed with result 'timeout'.

```

However, the main issue with Docker is, that the platform data isn’t persisted between container restarts. Ideally the path `/var/snap/platform` should be mounted as Docker volume, e.g.:

```auto
docker run \
  --restart=always \
  --name=syncloud \
  --volume=/var/lib/syncloud:/opt/disk/internal \
  --volume=/opt/syncloud:/var/snap/platform \
  --privileged \
  --detach=true \
  --publish=443:443 \
  --publish=80:80 \
  syncloud/platform-amd64

```

but is doesn’t work, as syncloud won’t create directory structure in mounted volume. From Docker it appears as:

```auto
/dev/md0 on /var/snap/platform type ext4 (rw,relatime,errors=remount-ro,stripe=256)

```

Would it be possible to support Docker volumes for platform data?

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [29 July 2021 14:50 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/7 "2021-07-29T14:50:47Z")

</div>

I see, did you copy the contents of this dir to the host before mounting it?

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [31 July 2021 09:54 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/8 "2021-07-31T09:54:50Z")

</div>

I’ve tried both. Copying existing data and staring with an empty directory. Both with the same result.

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [31 July 2021 18:33 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/9 "2021-07-31T18:33:49Z")

</div>

> [@tombart](#):
>
> persist data between Docker container restarts

By the way, docker does not lose containers filesystem changes between restarts unless you create a new container from the image. What exactly are you trying to fix?

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [2 August 2021 08:07 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/10 "2021-08-02T08:07:00Z")

</div>

What about syncloud upgrades? How do you plan to persist data after Docker image upgrade?

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [2 August 2021 09:10 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/11 "2021-08-02T09:10:00Z")

</div>

Actually we almost never upgrade OS itself as everything is included in the platform package which you can upgrade from Settings - Updates - System.  
But even if we wanted to upgrade kernel (one of the things we do not ship in platform package) it would not help docker as it uses host OS kernel.  
Syncloud Docker image is like a full device (without kernel) running the full systemd init process as real device does.  
We are ready to improve things in docker if it solves real issues.

---

<div class="post-metadata">

### Author: ![tombart](https://yyz2.discourse-cdn.com/free1/user_avatar/syncloud.discourse.group/tombart/32/37_2.png) [@tombart](https://syncloud.discourse.group/u/tombart)
#### Post date: [2 August 2021 10:51 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/12 "2021-08-02T10:51:40Z")

</div>

Missing data backup is not an issue?

---

<div class="post-metadata">

### Author: ![boris](https://avatars.discourse-cdn.com/v4/letter/b/74df32/32.png) [@boris](https://syncloud.discourse.group/u/boris)
#### Post date: [4 August 2021 21:13 UTC](https://syncloud.discourse.group/t/docker-image-doesnt-work/84/13 "2021-08-04T21:13:36Z")

</div>

All your data generated by apps (files) will be here:

```auto
--volume=/var/lib/syncloud:/opt/disk/internal

```

If you want to backup app settings which are stored under corresponding /var/snap/[app] you can use backup feature from the app page. Backups are stored under the above volume so you can migrate everything to another container if you want just using this volume.
