Skip to main content

docker-push-ssh

PyPI version Build Status

Push docker images from your local machine to remote servers without the hassle.

Overview

docker-push-ssh is a command line utility to push docker images from your local machine to your remote machine via ssh.

It creates a private docker registry on your server, establishes a ssh tunnel (so the registry is never exposed to the public), and uploads your docker image over this ssh tunnel.

Tested on OS X with "Docker for Mac".

Install

  1. Install via pip: pip install docker-push-ssh

  2. Add localhost:5000 to your docker client's insecure registries (requires restart of docker):

[OS X] How to Add Insecure Registry

[Linux] How to Add Insecure Registry

Adding localhost:5000 to your client's insecure registries is inconvenient but a side-effect of docker's design. It only needs to be done once from each machine using docker-push-ssh. This allows the tool to push through the ssh tunnel at localhost:5000 to the temporary registry on your remote host, without needing ssl certificates for your server.

Usage:

$ docker-push-ssh --help
usage: docker-push-ssh [-h] [-i SSH_IDENTITY_FILE] [-p SSH_PORT]
              ssh_host docker_image [docker_image ...]

A utility to securely push a docker image from your local host to a remote
host over ssh without using docker save/load or needing to setup a private
registry.

positional arguments:
  ssh_host              Host to push docker image to. (ex.
                        username@myhost.com)
  docker_image          Docker image tag(s) to push. Specify one or more
                        separated by spaces.

optional arguments:
  -h, --help            show this help message and exit
  -i SSH_IDENTITY_FILE, --ssh-identity-file SSH_IDENTITY_FILE
                        [required] Path to the ssh identity file on your local
                        host. Required, password auth not supported.
  -p SSH_PORT, --ssh-port SSH_PORT
                        [optional] Port on ssh host to connect to. (Default is
                        22)

Examples

First create a test image we can use:

$ mkdir /tmp/testimage && cd /tmp/testimage
$ echo "FROM alpine" >> ./Dockerfile
$ echo "RUN touch /etc/testimage" >> ./Dockerfile
$ docker build -t testimage .

Now push that test image to our remote server:

$ docker-push-ssh -i ~/my_identity_file root@myserver.com testimage
...

Now the testimage will be present on your server.

Caveats

  1. SSH password authentication is not supported. Only key files.

Metadata

Release files for docker-push-ssh 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker-push-ssh 0.1.5
File Size Uploaded
docker-push-ssh-0.1.5.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docker-push-ssh 0.1.5
File Interpreter ABI Platform
docker_push_ssh-0.1.5-py2-none-any.whl Python 2 none any Details

Total release size: 14.6 kB

Release files / docker-push-ssh-0.1.5.tar.gz

Download URL docker-push-ssh-0.1.5.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
47363fe46dd85cfee23dc5406a381172122a63aac074bb5d746efcec92caf313
BLAKE2b-256 checksum
How to use checksums
7ad64069fa8040bdc4353b26994612b3dfdca0525d170fd7621faa4747c4b603
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

Release files / docker_push_ssh-0.1.5-py2-none-any.whl

Download URL docker_push_ssh-0.1.5-py2-none-any.whl
Size 9.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
343291ebea7830eb5b6acdba60ea86e651f33fde8b269d78204b2f2853ffe79e
BLAKE2b-256 checksum
How to use checksums
a85e8e2b8b5ce42fd078ceff84c92fa9f229a4dad1dd205a49c5fedb62b9879f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.14

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page