CausticLab / filesync

Filesync is a utility written in Golang which helps you to keep the files on the client up to date with the files on the server.
0 stars 0 forks source link

Dockerfile - tweaks #2

Open Munsio opened 7 years ago

Munsio commented 7 years ago

Using alpine linux on live Dockerfile to reduce image size cause we don't need to compile it so we don't need glibc

emcniece commented 7 years ago

Unfortunately, the https://github.com/elgs/filesync package (specifically sqlite3) is a CGO module, and needs to be compiled. Also the runtime operation of this binary requires static libraries that only appear to be present in installations that have glibc.

For example, changing the Dockerfile to pull from a different image:

#FROM busybox:ubuntu-14.04
FROM alpine:latest
MAINTAINER CausticLab

ENV FILESYNC_RELEASE v0.0.1

... will build, but running the image results in the following error:

standard_init_linux.go:178: exec user process caused "no such file or directory"

Entering the container and executing ldd /usr/local/bin/filesync reveals that this binary requires libraries, and these libraries are not present in the alpine base image.

One user suggested symlinking these libraries, but I didn't have luck with this.