I've to create a docker image, starting from a distroless base image, with some custom files. I use JIB with maven on my spring boot project. I'm working on Windows 7 with Docker toolbox. this is the step than I do for now:
1) create Dockerfile with these entries:
FROM gcr.io/distroless/java:8
COPY known_hosts ~/.ssh/known_hosts
EXPOSE 8888
2) execute the command:
docker build -t conf_server_image .
3) added follow lines on pom.xml:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<from>
<image>conf_server_image:latest</image>
</from>
<to>
<image>${project.artifactId}:${project.version}</image>
</to>
<container>
<jvmFlags>
<jvmFlag>-Xms512m</jvmFlag>
<jvmFlag>-Xmx512m</jvmFlag>
</jvmFlags>
</container>
</configuration>
</plugin>
4) execute command (with my ID ad pwd of docker.io):
docker login
4) execute the build command
mvnw clean compile jib:dockerBuild
but the process return me this error:
[INFO] Executing tasks:
[INFO] [============ ] 40,0% complete
[INFO] > building image to Docker daemon
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.941 s
[INFO] Finished at: 2020-04-10T11:26:59+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.1.0:dockerBuild (default-cli) on project sirio-configuration-server: Build to Docker daemon failed, pe
haps you should make sure your credentials for 'registry-1.docker.io/library/conf_server_image' are set up correctly. See https://github.com/GoogleContainerTools/jib/blob/mast
r/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized for help: Unauthorized for registry-1.docker.io/library/conf_server_image: 401 Unauthorized
[ERROR] {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"library/conf_server_image","Action":"pull"}]}]}
[ERROR] -> [Help 1]
[ERROR]
what am i forgetting? Thanks