mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-05 04:17:06 +00:00
Since these are the user login containers, having the ability to add packages is useful (e.g. I quite often find I want strace). Doing this requires that we not share `/var` with the login containers since we want the apk database therein. Previously it was thought that the containers might need some parts of `/var` for `ctr` to work (e.g. `/var/lib/containerd`) but this is not the case now (if it ever was) based on my testing. Fixes #2206. Signed-off-by: Ian Campbell <ijc@docker.com>
25 lines
888 B
Docker
25 lines
888 B
Docker
FROM linuxkit/alpine:a39a433162a873519910a07beeb3e8db22529956 AS mirror
|
|
|
|
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
|
|
RUN apk add --no-cache --initdb -p /out \
|
|
alpine-baselayout \
|
|
apk-tools \
|
|
busybox \
|
|
ca-certificates \
|
|
musl \
|
|
openssh-server \
|
|
tini \
|
|
util-linux \
|
|
&& true
|
|
RUN mv /out/etc/apk/repositories.upstream /out/etc/apk/repositories
|
|
|
|
FROM scratch
|
|
ENTRYPOINT []
|
|
WORKDIR /
|
|
COPY --from=mirror /out/ /
|
|
COPY etc/ /etc/
|
|
COPY usr/ /usr/
|
|
RUN mkdir -p /etc/ssh /root/.ssh && chmod 0700 /root/.ssh
|
|
CMD ["/sbin/tini", "/usr/bin/ssh.sh"]
|
|
LABEL org.mobyproject.config='{"pid": "host", "binds": ["/root/.ssh:/root/.ssh", "/etc/resolv.conf:/etc/resolv.conf", "/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}'
|