mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-25 21:53:06 +00:00
Mounting a directory inside a read only container requires that to be created in advance, but `runc` worked around that if the rootfs was not originally read only. You cannot even bind mount a file that does not exist into a read only container. The containerd test is given a disk, as running on an overlay does not work; however it is also disabled as one of the parts of the test is failing, needs investigation. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
35 lines
1.3 KiB
Docker
35 lines
1.3 KiB
Docker
FROM linuxkit/alpine:cb6a0b2b068d892996ebadae999d9baf6e08be5b AS mirror
|
|
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
|
# btrfs-progfs is required for btrfs test (mkfs.btrfs)
|
|
# util-linux is required for btrfs test (losetup)
|
|
RUN apk add --no-cache --initdb -p /out \
|
|
alpine-baselayout \
|
|
busybox \
|
|
btrfs-progs \
|
|
btrfs-progs-dev \
|
|
gcc \
|
|
git \
|
|
go \
|
|
libc-dev \
|
|
linux-headers \
|
|
make \
|
|
musl \
|
|
util-linux \
|
|
tzdata
|
|
RUN rm -rf /out/etc/apk /out/lib/apk /out/var/cache
|
|
RUN cp /out/usr/share/zoneinfo/UTC /out/etc/localtime
|
|
|
|
FROM scratch
|
|
COPY --from=mirror /out/ /
|
|
ENV GOPATH=/go
|
|
RUN mkdir -p $GOPATH/src/github.com/containerd && \
|
|
cd $GOPATH/src/github.com/containerd && \
|
|
git clone https://github.com/containerd/containerd.git
|
|
WORKDIR $GOPATH/src/github.com/containerd/containerd
|
|
# CONTAINERD_COMMIT is defined in linuxkit/alpine
|
|
RUN git checkout $CONTAINERD_COMMIT
|
|
ADD run.sh ./run.sh
|
|
|
|
ENTRYPOINT ["/bin/sh", "run.sh"]
|
|
LABEL org.mobyproject.config='{"net": "host", "capabilities": ["all"], "tmpfs": ["/tmp:exec"], "binds": ["/dev:/dev", "/var:/var", "/etc/resolv.conf:/etc/resolv.conf", "/usr/bin/runc:/usr/bin/runc", "/usr/bin/containerd:/usr/bin/containerd", "/usr/bin/containerd-shim:/usr/bin/containerd-shim"], "mounts": [{"type": "cgroup", "options": ["rw","nosuid","noexec","nodev","relatime"]}],}'
|