Local Changes Requires Docker Hub Auth
See original GitHub issueI just want to make faster local development. At our company we have different cicd pipeline so I shouldn’t send new images a hub. If there is a small change I am following next commands to achieve changes. It takes time.
cd Mgnfcnt-Project;
rm -rf ./target;
mvn clean install -DskipTests;
docker stop Mgnfcnt-Project && docker rm Mgnfcnt-Project && docker rmi mgnfcnt_Mgnfcnt-Project;
docker-compose up -d Mgnfcnt-Project;
I dont know whether JIB is right solution or not for my problem but using as following:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<from>
<image>mgnfcnt_Mgnfcnt-Project:latest</image>
</from>
<to>
<image>mgnfcnt_Mgnfcnt-Project</image>
</to>
</configuration>
</plugin>
But still wants to reach docker hub as gives following error:
Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.1.0:build (default-cli) on project Mgnfcnt-Project: Build image failed, perhaps you should make sure your credentials for ‘registry-1.docker.io/library/mgnfcnt_Mgnfcnt-Project’ are set up correctly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized for help
Thanks in advance
Issue Analytics
- State:
- Created 3 years ago
- Comments:35 (19 by maintainers)
Top GitHub Comments
On a fast network, ideally consecutive
jib:build
(i.e., remote registry push) runs without any changes should take a few seconds. If you make a change only to your application, normally it should still take a few or several seconds (excluding the time to rebuild your classes withmvn compile
).jib:dockerBuild
should usually be comparably fast. It can be faster thanjib:build
if your image is reasonably small and your machine is good enough; it can be slower if your image is huge.I will update here about “RUN” later.
Sorry for the late update. Re: putting arbitrary files into to the image, please see this doc.
If you need, you can leverage other plugins to dynamically download files online and put them into one of the
<extraDirectories>
at compile-time. Here’a an example to download a Cloud Java Debugger agent.Regarding why you can’t do
Dockerfile
’sRUN
-like things in Jib, I’ll quote the following comments (from https://github.com/GoogleContainerTools/jib/issues/1806#issuecomment-505526975 and https://github.com/GoogleContainerTools/jib/issues/2249#issuecomment-578937936).