Place /etc/passwd file inside the container for root user
This is needed because ssh requires the user that runs it to exist in /etc/passwd.
This commit is contained in:
parent
6c8faca7a4
commit
f2786e17ae
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*~
|
||||
*.tar.gz
|
||||
passwd
|
||||
|
@ -1,6 +1,7 @@
|
||||
FROM scratch
|
||||
ADD guix-tarball-pack.tar.gz /guix-builder
|
||||
ADD links.tar.gz /
|
||||
ADD passwd /etc/passwd
|
||||
|
||||
VOLUME /var/guix/daemon-socket/socket /gnu/store /etc/ssl
|
||||
ENTRYPOINT ["/guix-builder/bin/bash"]
|
||||
|
8
Makefile
8
Makefile
@ -5,8 +5,12 @@ GUIX_MANIFEST_DEV := manifest-dev.scm
|
||||
|
||||
TARBALL ?= guix-tarball-pack.tar.gz
|
||||
LINKS_TARBALL ?= links.tar.gz
|
||||
PASSWD_FILE ?= passwd
|
||||
IMAGE_TAG ?= guix-builder
|
||||
|
||||
$(PASSWD_FILE):
|
||||
echo 'root:x:0:0:root:/root:/bin/sh' > passwd
|
||||
|
||||
$(LINKS_TARBALL):
|
||||
ln -s /guix-builder/bin bin
|
||||
tar -czvf $@ bin
|
||||
@ -17,7 +21,7 @@ $(TARBALL):
|
||||
@chmod +w $@
|
||||
|
||||
.PHONY: build
|
||||
build: $(TARBALL) $(LINKS_TARBALL)
|
||||
build: $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)
|
||||
@docker build -t $(IMAGE_TAG) .
|
||||
|
||||
.PHONY: run
|
||||
@ -36,4 +40,4 @@ shell:
|
||||
|
||||
.PHONY:
|
||||
clean:
|
||||
rm -r $(TARBALL) $(LINKS_TARBALL)
|
||||
rm -r $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)
|
||||
|
Loading…
Reference in New Issue
Block a user