Now that we have contained our Vault service inside a Docker container, we are going to do some useful things with it.
The first thing we are going to do is push this to the Docker Hub so that other people may spin up their own instances or even build new images based on it.
Head over to Docker Hub at https://hub.docker.com and create an account by clicking on the Log In link in the top-right-hand corner and then clicking on Create Account. Of course, if you already have an account, just log in.
Now in a terminal, you are going to authenticate with this account by running Docker's login
command:
docker login -u USERNAME -p PASSWORD https://index.docker.io/v1/
Ensure that you replace USERNAME
and PASSWORD
with your actual username and password of the account you just created.
If successful, you'll see, Login Succeeded.
Next, back in the web browser, click on Create Repository and create a new repository called vault
. The actual name for this image is going to be USERNAME/vault
, so we're going to need to rebuild the image locally to match this.
In a terminal, build the new repository with the correct name:
docker build -t USERNAME/vault
This will build the image again, this time with the appropriate name. To deploy the image to the Docker Hub, we use Docker's push
command:
docker push USERNAME/vault
After some time, the image and its dependencies will be pushed to Docker Hub:
f477b97e9e48: Pushed 384c907d1173: Pushed 80168d020f50: Pushed 0ceba54dae47: Pushed 4d7388e75674: Pushed f042db76c15c: Pushing [====> ] 21.08 MB/243.6 MB d15a527c2ee1: Pushing [=====> ] 15.77 MB/134 MB 751f5d9ad6db: Pushing [======> ] 16.49 MB/122.6 MB 17587239b3df: Pushing [===================>] 17.01 MB/44.31 MB 9e63c5bce458: Pushing [==================> ] 65.58 MB/125.1 MB
Now head over to the Docker Hub to see the details of your image, or look at an example at https://hub.docker.com/r/matryer/vault/.
3.129.26.108