January 2018
Intermediate to advanced
414 pages
10h 29m
English
Now we'd like to publish our Docker image to Docker Hub; but before we can, we need to build our images for our repository. When we create an account in Docker Hub, a repository with our username will be created; in this example, it will be mydockerhubuser.
In order to build the Docker for our repository, we can use this command from our microservice directory:
docker build . -t mydockerhubuser/chapter07
This should be quite a fast process since all the different layers are cached:
Sending build context to Docker daemon 21.58MBStep 1/3 : FROM openjdk:8-jdk-alpine ---> a2a00e606b82Step 2/3 : ADD target/*.jar microservice.jar ---> Using cache ---> 4ae1b12e61aaStep 3/3 : ENTRYPOINT java -jar microservice.jar ---> Using cache ...
Read now
Unlock full access