Skip to content

Commit 6e834ed

Browse files
author
Kirill Müller
committed
add Makefile
1 parent 3028ce0 commit 6e834ed

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
all: test
2+
3+
CONTAINER_NAME=debian-ssh:latest
4+
5+
killall: .FORCE
6+
docker kill $$(docker ps | sed -r -n '/^[^ ]+ +$(CONTAINER_NAME) / {s/ .*$$//;p}')
7+
8+
build:
9+
docker build -t $(CONTAINER_NAME) .
10+
11+
test: build .FORCE
12+
docker run -d -p 2222:22 -e SSH_KEY="$$(cat ~/.ssh/id_rsa.pub)" $(CONTAINER_NAME)
13+
while ! ssh root@localhost -p 2222 -o "StrictHostKeyChecking=no" env; do sleep 0.1; done
14+
docker kill $$(docker ps -ql)
15+
16+
debug-ssh: build .FORCE
17+
docker run -p 2222:22 -e SSH_KEY="$$(cat ~/.ssh/id_rsa.pub)" $(CONTAINER_NAME)
18+
19+
debug-connect: .FORCE
20+
ssh root@localhost -p 2222 -o "StrictHostKeyChecking=no" env
21+
22+
.FORCE:

0 commit comments

Comments
 (0)