alfa-bravo / docker-push-ssh

Push docker images from your local machine to remote servers without the hassle.
Apache License 2.0
0 stars 0 forks source link

Consecutive calls to or multiple image names causes docker-push-ssh to hang #1

Open Apelsin opened 5 years ago

Apelsin commented 5 years ago

From the pipeline build

[Pipeline] sh
[kolorskemo-master] Running shell script
+ docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master
[REQUIRED] Ensure localhost:5000 is added to your insecure registries.
Setting up secure private registry... 
Establishing SSH Tunnel...
Waiting for SSH Tunnel Initialization...
Tagging image(s) for push...
Pushing Image(s) from local host...
Pushed Image kolorskemo-client:master Successfully...
Pulling and Retagging Image on remote host...
Pulled Image kolorskemo-client:master Successfully...
Cleaning up...
[Pipeline] sh
[kolorskemo-master] Running shell script
+ docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-server:master

...should not take more than like 20 seconds but ends up hanging indefinitely. 5 minutes later...

Aborted by ***
Sending interrupt signal to process
Terminated

The issue likely has something to do with how the containers are created and destroyed here: https://github.com/alfa-bravo/docker-push-ssh/blob/2eca1ca077cceb64a912dc7b9f4f1619d75779c1/docker_push_ssh/cli.py

Issue is produced by

docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master kolorskemo-server:master # this call hangs

or by

docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master
docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-server:master # this call hangs

and the related Jenkins pipeline script instructions that includes those commands has

// Build docker images
sh 'docker build -t kolorskemo-client:master ./client'
sh 'docker build -t kolorskemo-server:master ./server'

// Push docker image to production/dev server
// https://pypi.org/project/docker-push-ssh/
sh 'docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master'
sh 'docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-server:master'
Apelsin commented 5 years ago

Jenkins pipeline build instruction with a single call to docker-push-ssh

sh 'docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master kolorskemo-server:master'

...and the build output for that...

[Pipeline] sh
[kolorskemo-master] Running shell script
+ docker-push-ssh -i /***/***/***/jenkins/.ssh/id_rsa deploy@kolorskemo.com kolorskemo-client:master kolorskemo-server:master # this command hangs