Hi,
I’m trying to build a docker image using ubuntu as a base. I’m getting a .deb package using wget then using “dpkg -i” to install this. The deb package is http://packages.couchbase.com/releases/couchbase-sync-gateway/1.4.0/couchbase-sync-gateway-community_1.4.0-2_x86_64.deb
The failure happens during the dpkg postinst configure phase, when it tries to perform the following: systemctl start sync_gateway
This fails with the error Failed to connect to bus: No such file or directory
Which then stops my whole build.
I’ve read this discussion of a similar failute (systemctl giving the same error in a docker container). However, that relates to the error when running the docker container, not when building the image.
The official Dockerfile for sync_gateway uses centos and that works. However, I want to use ubuntu as I want to do a couple of other things in the same container. Outside of docker, sync gateway works fine on Ubuntu. I don’t think this is a sync_gateway problem, more a problem with the docker build process that I’m doing, which is why I’m asking here.
I have my answer now. The problem is that systemd is not running in the ubuntu docker. My solution is to use “dpkg --unpack” rather than “dpkg --install”, then run a cut down version of the postinst script separately.