mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-03-26 12:29:07 +00:00
ssh by IP in test; verbose SSH into container
This commit is contained in:
8
Makefile
8
Makefile
@@ -26,13 +26,15 @@ release: test tag_latest
|
|||||||
docker push $(NAME)
|
docker push $(NAME)
|
||||||
@echo "*** Don't forget to create a tag by creating an official GitHub release."
|
@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:
|
ssh:
|
||||||
chmod 600 image/services/sshd/keys/insecure_key
|
chmod 600 ${SSH_IDENTITY_FILE}
|
||||||
@ID=$$(docker ps | grep -F "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
|
ID=$$(docker ps | grep -F "$(NAME):$(VERSION)" | awk '{ print $$1 }') && \
|
||||||
if test "$$ID" = ""; then echo "Container is not running."; exit 1; fi && \
|
if test "$$ID" = ""; then echo "Container is not running."; exit 1; fi && \
|
||||||
IP=$$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $$ID) && \
|
IP=$$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $$ID) && \
|
||||||
echo "SSHing into $$IP" && \
|
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:
|
test_release:
|
||||||
echo test_release
|
echo test_release
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ docker exec $ID rm /etc/service/sshd/down
|
|||||||
docker exec $ID sv start /etc/service/sshd
|
docker exec $ID sv start /etc/service/sshd
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
echo " --> Logging into container and running tests"
|
echo " --> Logging into container and running test"
|
||||||
cp image/services/sshd/keys/insecure_key /tmp/insecure_key
|
cp image/services/sshd/keys/insecure_key /tmp/insecure_key
|
||||||
chmod 600 /tmp/insecure_key
|
|
||||||
sleep 1 # Give container some more time to start up.
|
sleep 1 # Give container some more time to start up.
|
||||||
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /tmp/insecure_key -p $SSHPORT root@127.0.0.1 \
|
NAME=$NAME VERSION=$VERSION SSH_IDENTITY_FILE=/tmp/insecure_key \
|
||||||
/bin/bash /test/test.sh
|
SSH_COMMAND="/bin/bash /test/test.sh" make ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user