mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-12 05:23:56 +00:00
This is mainly for testing. You can run with something like ``` docker run -v ~/.ssh/id_rsa.pub:/root/.ssh/authorized_keys -p 2222:22 -e TINI_SUBREAPER=1 --pid=host mobylinux/sshd:36c44542d8120e384c724a078e3e489f7a58382c ``` if you want to run in the host pid namespace. You must provide an authorized key, you may provide a host key. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
30 lines
765 B
Makefile
30 lines
765 B
Makefile
.PHONY: tag push
|
|
|
|
BASE=alpine:edge
|
|
IMAGE=sshd
|
|
|
|
default: push
|
|
|
|
hash: Dockerfile etc/ssh/sshd_config usr/bin/ssh.sh etc/motd
|
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
|
docker run --rm $(IMAGE):build sh -c "cat $^ /lib/apk/db/installed | sha1sum" | sed 's/ .*//' > $@
|
|
|
|
push: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
|
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
tag: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
clean:
|
|
rm -f hash
|
|
|
|
.DELETE_ON_ERROR:
|