Docker Hub

How to build Dockerfile and push to Docker Hub.

First make sure you have a Docker Hub account and have created an access token to use with the CLI commands.

Login

From the CLI, do:

docker login

Enter username and for password use the access token.

Build

Run this command from the same directory as your Dockerfile to build it with the image name privacyroot:

docker build -t privacyroot .

Check with docker images to see the newly built image.

Tag

Where the newly built image name is privacyroot and the Docker Hub repo is gomarcd/privacyroot, tag the image with:

docker tag privacyroot gomarcd/privacyroot

If specifying version, use the convention:

docker tag privacyroot gomarcd/privacyroot:v2

As needed. Otherwise it will apply to the :latest tag automatically.

Push

To upload the newly built and tagged image to Docker Hub, do:

docker push gomarcd/privacyroot