From 34fbe42615f500a822bceb306be0abaffa494851 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 23 Jun 2017 10:56:38 +0100 Subject: [PATCH] getty,sshd: Mount host /tmp into containers. ctr (which runs in the getty or ssh container) relies on sharing files in /tmp with containerd (which runs in the host mount namespace). Specifically it currently uses paths under /tmp/containerd for the stdio FIFOs of containers, resulting in: # ctr run -t docker.io/library/redis:alpine test ctr: rpc error: code = Unknown desc = runtime create failed: runc create failed: container with id exists: test Currently it is not possible to specify a non-existent source directory for a bind mount, so we cannot easily bind just /tmp/containerd. Sharing all of /tmp doesn't sound like a terrible idea anyway. Defering updating the sha in *.yml until after some further changes to these packages. Signed-off-by: Ian Campbell --- pkg/getty/Dockerfile | 2 +- pkg/sshd/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/getty/Dockerfile b/pkg/getty/Dockerfile index defd12c3f..d29a2267b 100644 --- a/pkg/getty/Dockerfile +++ b/pkg/getty/Dockerfile @@ -28,4 +28,4 @@ COPY --from=mirror /out/ / COPY usr/ /usr/ COPY etc/ /etc/ CMD ["/usr/bin/rungetty.sh"] -LABEL org.mobyproject.config='{"pid": "host", "net":"host", "binds": ["/run:/run", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/usr/bin/dist:/usr/bin/dist", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}' +LABEL org.mobyproject.config='{"pid": "host", "net":"host", "binds": ["/run:/run", "/tmp:/tmp", "/etc:/hostroot/etc", "/usr/bin/ctr:/usr/bin/ctr", "/usr/bin/runc:/usr/bin/runc", "/usr/bin/dist:/usr/bin/dist", "/var:/var","/containers:/containers","/dev:/dev","/sys:/sys"], "capabilities": ["all"]}' diff --git a/pkg/sshd/Dockerfile b/pkg/sshd/Dockerfile index 31c48bc7e..9e6f6550a 100644 --- a/pkg/sshd/Dockerfile +++ b/pkg/sshd/Dockerfile @@ -19,4 +19,4 @@ 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"], "capabilities": ["all"]}' +LABEL org.mobyproject.config='{"pid": "host", "binds": ["/tmp:/tmp", "/root/.ssh:/root/.ssh", "/etc/resolv.conf:/etc/resolv.conf"], "capabilities": ["all"]}'