1
0
mirror of https://github.com/phusion/baseimage-docker.git synced 2026-03-25 20:07:55 +00:00

ssh by IP in test; verbose SSH into container

This commit is contained in:
Matyas Markovics
2019-03-13 10:37:56 +01:00
parent 17a737f47b
commit ad88ec9226
2 changed files with 8 additions and 7 deletions

View File

@@ -26,13 +26,15 @@ release: test tag_latest
docker push $(NAME)
@echo "*** Don't forget to create a tag by creating an official GitHub release."
ssh: SSH_COMMAND?=
ssh: SSH_IDENTITY_FILE?=image/services/sshd/keys/insecure_key
ssh:
chmod 600 image/services/sshd/keys/insecure_key
@ID=$$(docker ps | grep -F "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
chmod 600 ${SSH_IDENTITY_FILE}
ID=$$(docker ps | grep -F "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
if test "$$ID" = ""; then echo "Container is not running."; exit 1; fi && \
IP=$$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $$ID) && \
echo "SSHing into $$IP" && \
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i image/services/sshd/keys/insecure_key root@$$IP
ssh -v -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${SSH_IDENTITY_FILE} root@$$IP ${SSH_COMMAND}
test_release:
echo test_release