mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-09 13:14:04 +00:00
Previously memlogd would always run in the foreground. This patch adds a `-daemonize` option which binds the /var/run sockets, forks and execs itself and immediately returns. Therefore the program won't block (important for an init.d script) but guarantees the sockets will be available for any program started afterwards. This also removes the alpine base from the memlogd image as `init` "containers" are treated as simple file overlays. Signed-off-by: David Scott <dave.scott@docker.com>
20 lines
503 B
Docker
20 lines
503 B
Docker
FROM linuxkit/alpine:1b05307ae8152e3d38f79e297b0632697a30c65c AS build
|
|
|
|
RUN apk add --no-cache go musl-dev
|
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
|
|
|
COPY cmd/ /go/src/
|
|
RUN go-compile.sh /go/src/memlogd
|
|
RUN go-compile.sh /go/src/logread
|
|
RUN go-compile.sh /go/src/logwrite
|
|
|
|
FROM scratch
|
|
ENTRYPOINT []
|
|
CMD []
|
|
WORKDIR /
|
|
COPY --from=build /go/bin/memlogd usr/bin/memlogd
|
|
COPY --from=build /go/bin/logread usr/bin/logread
|
|
COPY --from=build /go/bin/logwrite usr/bin/logwrite
|
|
# We'll start from init.d
|
|
COPY etc/ /etc/
|