mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-25 10:02:31 +00:00
This adds support for a runtime configuration file that can do: - `mkdir` to make a directory at runtime, eg in `/var` or `/tmp`, to avoid workarounds - `interface` that can create network interfaces in a container or move them - `bindNS` that can bind mount namespaces of an `onboot` container to a file so a service can be started in that namespace. It merges the `service` and `onboot` tools (in `init`) to avoid duplication. This also saves some size for eg LCOW which did not use the `onboot` code in `runc`. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
FROM linuxkit/alpine:6ed3b299f5243acb6459b4993549c5045e4ad7f4 as alpine
|
|
RUN \
|
|
apk add \
|
|
btrfs-progs-dev \
|
|
gcc \
|
|
git \
|
|
go \
|
|
libc-dev \
|
|
linux-headers \
|
|
make \
|
|
tzdata \
|
|
&& true
|
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
|
# CONTAINERD_REPO and CONTAINERD_COMMIT are defined in linuxkit/alpine
|
|
RUN mkdir -p $GOPATH/src/github.com/containerd && \
|
|
cd $GOPATH/src/github.com/containerd && \
|
|
git clone $CONTAINERD_REPO
|
|
WORKDIR $GOPATH/src/github.com/containerd/containerd
|
|
RUN git checkout $CONTAINERD_COMMIT
|
|
RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS="-extldflags \\\"-fno-PIC -static\\\""
|
|
RUN cp bin/containerd bin/ctr bin/containerd-shim /usr/bin/
|
|
|
|
RUN mkdir -p /etc/init.d && ln -s /usr/bin/service /etc/init.d/020-containerd
|
|
|
|
WORKDIR /
|
|
COPY . .
|
|
|
|
FROM scratch
|
|
ENTRYPOINT []
|
|
WORKDIR /
|
|
COPY --from=alpine /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/
|
|
COPY --from=alpine /etc/containerd/config.toml /etc/containerd/
|
|
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
|
|
COPY --from=alpine /etc/init.d/ /etc/init.d/
|
|
COPY etc etc/
|