This tutorials will walk you through how to build and push a container image to Docker Hub (Docker's public container registry) and then import it into Uffizzi.
This tutorial assumes that you have already completed the following prerequisite steps:
Create a repository on Docker Hub
To create a repo:
Sign in to Docker Hub.
Click on Create Repository:
Name it <your-username>/my-first-repo as shown below. Select Private:
- Now that you've created a repo, you should see:
Download Docker Desktop and login
You’ll need to download Docker Desktop to build and push a container image to Docker Hub.
Open the terminal and sign in to Docker Hub on your computer by running
Build and push a container image to Docker Hub from your computer
Docker can build images automatically by reading the instructions from a
Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using
docker build users can create an automated build that executes several command-line instructions in succession.
- Start by creating a Dockerfile for your app. Below are some examples if you need help getting started.
docker build -t <your_username>/my-first-repo .to build your Docker image.
docker run <your_username>/my-first-repoto test your Docker image locally.
docker push <your_username>/my-first-repoto push your Docker image to Docker Hub.
And in Docker Hub, your repository should have a new
latest tag available under Tags:
Link your Docker Hub account to Uffizzi
- Login to Uffizzi
- Create a new app environment
- At the Import your app step, select Docker Hub.
- On the next page, enter your Docker Hub credentials to link your account.
- Select your Docker image <your-username>/my-first-repo and select the
latesttag. Then click Go to next step.
- Configure your app by setting your HTTP port and any environment variables your app requires. Then click Go to next step.
- On the database selection page click Skip this step.
- Finally, review your selection and click Deploy Now.