mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-27 02:08:58 +00:00
Add pkg/host-timesync-daemon
Some hypervisors (e.g. hyperkit / xhyve) don't provide a good way to keep the VM's clock in sync with the Host's clock. NTP will usually keep the clocks together, but after a the host or VM is suspended and resumed the clocks can be suddenly too far apart for NTP to work properly. This simple daemon listens on an AF_VSOCK port and resynchronises the VM clock from the virtualised hardware clock. This is a Go conversion of original C code written by Magnus Skjegstad <magnus@skjegstad.com> Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
22
pkg/host-timesync-daemon/Dockerfile
Normal file
22
pkg/host-timesync-daemon/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM linuxkit/alpine:2e362f4459ba4491655061cccdd2fcc7a2de5eb3 AS mirror
|
||||
|
||||
RUN apk add --no-cache go musl-dev git
|
||||
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||
|
||||
ENV VIRTSOCK_COMMIT=a381dcc5bcddf1d7f449495c373dbf70f8e501c0
|
||||
RUN mkdir -p $GOPATH/src/github.com/linuxkit && \
|
||||
cd $GOPATH/src/github.com/linuxkit && \
|
||||
git clone https://github.com/linuxkit/virtsock.git && \
|
||||
cd virtsock && \
|
||||
git checkout $VIRTSOCK_COMMIT
|
||||
|
||||
COPY . /go/src/host-timesync-daemon
|
||||
RUN go-compile.sh /go/src/host-timesync-daemon
|
||||
|
||||
FROM scratch
|
||||
ENTRYPOINT []
|
||||
CMD []
|
||||
WORKDIR /
|
||||
COPY --from=mirror /go/bin/host-timesync-daemon /usr/bin/host-timesync-daemon
|
||||
CMD ["/usr/bin/host-timesync-daemon", "-port", "0xf3a4"]
|
||||
LABEL org.mobyproject.config='{"binds": [ "/dev/rtc0:/dev/rtc0" ], "capabilities": ["CAP_SYS_TIME"]}'
|
Reference in New Issue
Block a user