There are many options available for storing docker images.
Storage in a public repository
For pipelines that are publicly available, dockerhub is the simplest option.
Dockerhub allows unlimited public repositories with a free account, where anyone can pull your images.
An existing image can be copied and renamed using your dockerhub user ID with:
docker tag image_name:0.0.1 userID/image_name:0.0.1
And then pushed to you dockerhub repository with:
docker push userID/image_name:0.0.1
Storage in a private repository
To store your docker images privately, we recommend amazon's elastic container registry (ECR).
With ECR, you have two options:
Option 1:
Store the image under your own aws account and setup the proper IAM policy to allow Basepair to pull images from your repository
Option 2:
Store the image in Basepair's ECR:
We will setup the proper IAM policy allowing you to push images to a private repository in our ECR.
- to do this, first contact a Basepair team member in order to share the necessary aws credentials
- once Basepair has created the repository, we will share the information needed for you to push images
*in the example code below, you will need to change values in brackets [] for your use:
Step 1: build the image using a tag that contains the repositoryUri we shared with you, the image name you want to use, and version ("v0.0.1")
cd /path/to/your/project # this is where the Dockerfile is present docker build -f Dockerfile -t [repositoryUri]:[image_name]-[v0.0.1] .
check to make sure the image was created by listing existing images on your machine:
docker image ls
Step 2: get a temporary docker credential from ECR for use with docker login
aws ecr get-login-password \ --region [region] \ | docker login --username AWS \ --password-stdin [aws_id].dkr.ecr.[region].amazonaws.com
Step 3: push the image to Basepair's ECR using the repositoryUri we shared with you
docker push [repositoryUri]:[image_name]-[v0.0.1]