Upload to docker hub - RamonPradoMoreno/learned-at-work GitHub Wiki
Uploading to a docker hub
This tutorial will guide you through an upload to a dockerhub.
Generate a docker image
Quarkus
Generate the maven artifact:
-
For a non native executable (JVM):
mvn package
-
For a native docker image:
mvn package -Pnative -Dquarkus.native.container-runtime=docker
Quarkus can generate more images, learn here.
Create the docker image in the image local repository:
-
For a JVM image:
docker build -f src/main/docker/Dockerfile.jvm -t smartgates/summary-mock .
-
For a native image:
docker build -f src/main/docker/Dockerfile.native -t smartgates/summary-mock .
Tag image
We need to adjust our tags to the docker hub expected tags. In order to do so we can use the tag command:
docker tag smartgates/summary-mock smartgates/summary-mock:v0.1
Note: You cannot upload a image with a nonexistent tag unless you use the admin user. If you feel that a custom tag would be useful contact the docker-hub administrator.
Push image
If you have a problem in this section check if it is related with permission management. If it is go see the docker-hub admin.
Login
You have to be logged in as a valid user in order to upload an image.
docker login -u rpardom
Push
docker push smartgates/summary-mock:v0.1