Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails due to proxy error #98

Closed
3kami3 opened this issue Apr 25, 2019 · 1 comment · Fixed by #99
Closed

Docker build fails due to proxy error #98

3kami3 opened this issue Apr 25, 2019 · 1 comment · Fixed by #99

Comments

@3kami3
Copy link

3kami3 commented Apr 25, 2019

EXPECTED RESULTS

Build succeeds

ACTUAL RESULTS

Build fails with error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.665 s
[INFO] Finished at: 2019-04-23T10:51:23Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.11 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-checkstyle-plugin:jar:2.11: Could not transfer artifact org.apache.maven.plugins:maven-checkstyle-plugin:pom:2.11 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
The command '/bin/sh -c mvn --batch-mode --define java.net.useSystemProxies=true package' returned a non-zero code: 1

STEPS TO REPRODUCE

$ git clone https://github.com/plantuml/plantuml-server.git
$ cd plantuml-server/
$ docker build --build-arg http_proxy=http://myproxy/ --build-arg https_proxy=http://myproxy/ -t plantuml:test -f Dockerfile.jetty .

ERROR LOG

$ git clone https://github.com/plantuml/plantuml-server.git
Cloning into 'plantuml-server'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 1939 (delta 0), reused 3 (delta 0), pack-reused 1934
Receiving objects: 100% (1939/1939), 6.71 MiB | 635.00 KiB/s, done.
Resolving deltas: 100% (706/706), done.
Checking connectivity... done.

$ cd plantuml-server/

$ docker build --build-arg http_proxy=http://myproxy/ --build-arg https_proxy=http://myproxy/ -t plantuml:test -f Dockerfile.jetty .
Sending build context to Docker daemon  259.1kB
Step 1/13 : FROM maven:3.6-jdk-8-slim AS builderjetty
3.6-jdk-8-slim: Pulling from library/maven
27833a3ba0a5: Already exists
16d944e3d00d: Pull complete
9019de9fce5f: Pull complete
9b053055f644: Pull complete
1c80aca6b8ec: Pull complete
38946562d2a7: Pull complete
96b0df30f304: Pull complete
ad67fddf8221: Pull complete
44a05031bddb: Pull complete
Digest: sha256:dce33cc7a4702cc5f3ea3a6deb4ea840c17001895ffe169d96e1fd9d7041eb15
Status: Downloaded newer image for maven:3.6-jdk-8-slim
 ---> b92711a7869c
Step 2/13 : COPY pom.xml /app/
 ---> 08810654b6a2
Step 3/13 : COPY src /app/src/
 ---> ae5378c98976
Step 4/13 : WORKDIR /app
 ---> Running in ca49caa9b409
Removing intermediate container ca49caa9b409
 ---> 68bb66250e6b
Step 5/13 : RUN mvn --batch-mode --define java.net.useSystemProxies=true package
 ---> Running in 929eedbc091f
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< org.sourceforge.plantuml:plantumlservlet >--------------
[INFO] Building PlantUML Servlet 1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/2.11/maven-checkstyle-plugin-2.11.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.665 s
[INFO] Finished at: 2019-04-23T10:51:23Z
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.11 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-checkstyle-plugin:jar:2.11: Could not transfer artifact org.apache.maven.plugins:maven-checkstyle-plugin:pom:2.11 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
The command '/bin/sh -c mvn --batch-mode --define java.net.useSystemProxies=true package' returned a non-zero code: 1
@3kami3
Copy link
Author

3kami3 commented Apr 25, 2019

I have rebuilt the modified base docker image back. The result was a success.

I think that commit of the cause of this failure is f878c0e .
@translucens Is it possible to revert the base docker image?

BUILD LOG

$ sed -i -e "s/3.6-jdk-8-slim/3.6-jdk-8/" Dockerfile.jetty

$ git diff
diff --git a/Dockerfile.jetty b/Dockerfile.jetty
index f1f36fa..6700925 100644
--- a/Dockerfile.jetty
+++ b/Dockerfile.jetty
@@ -1,4 +1,4 @@
-FROM maven:3.6-jdk-8-slim AS builderjetty
+FROM maven:3.6-jdk-8 AS builderjetty

 COPY pom.xml /app/
 COPY src /app/src/

$ docker build --build-arg http_proxy=http://myproxy/ --build-arg https_proxy=http://myproxy/ -t plantuml:test -f Dockerfile.jetty .
Sending build context to Docker daemon  259.1kB
Step 1/13 : FROM maven:3.6-jdk-8 AS builderjetty
3.6-jdk-8: Pulling from library/maven
e79bb959ec00: Already exists
d4b7902036fe: Already exists
1b2a72d4e030: Already exists
d54db43011fd: Already exists
1a97c78dad71: Already exists
6dcb79eeeda4: Already exists
bd56246cf4fd: Already exists
88cea60f56c5: Already exists
18604126c702: Pull complete
41d861886738: Pull complete
e39ba1fe0b52: Pull complete
Digest: sha256:99afb7446d45888adb79eb1f29b13cd677e3c7ebd05ad8fea555bf61e02e1906
Status: Downloaded newer image for maven:3.6-jdk-8
 ---> f44a5194086a
Step 2/13 : COPY pom.xml /app/
 ---> 9f7a5fd9c72f
Step 3/13 : COPY src /app/src/
 ---> 9625ef18375b
Step 4/13 : WORKDIR /app
 ---> Running in 1631ecb525c4
Removing intermediate container 1631ecb525c4
 ---> 8cf1680a7552
Step 5/13 : RUN mvn --batch-mode --define java.net.useSystemProxies=true package
 ---> Running in ccd498b07c03
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< org.sourceforge.plantuml:plantumlservlet >--------------
[INFO] Building PlantUML Servlet 1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/2.11/maven-checkstyle-plugin-2.11.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-checkstyle-plugin/2.11/maven-checkstyle-plugin-2.11.pom (12 kB at 8.2 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom (11 kB at 46 kB/s)

<snip>

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:15 min
[INFO] Finished at: 2019-04-23T10:56:03Z
[INFO] ------------------------------------------------------------------------
Removing intermediate container ccd498b07c03
 ---> 6da8c25605bb
Step 6/13 : FROM jetty:9.4-jre8
 ---> 5db3ae3d98cd

<snip>

Step 13/13 : COPY --from=builderjetty /app/target/plantuml.war /var/lib/jetty/webapps/$BASE_URL.war
 ---> e91288f87e55
Successfully built e91288f87e55
Successfully tagged plantuml:test

translucens added a commit to translucens/plantuml-server that referenced this issue Apr 27, 2019
headless OpenJDK does not refer `http_proxy` environment variable, so build image inside proxy will fail.
resolves plantuml#98
HeinrichAD pushed a commit to HeinrichAD/plantuml-server that referenced this issue Jul 19, 2023
headless OpenJDK does not refer `http_proxy` environment variable, so build image inside proxy will fail.
resolves plantuml#98
HeinrichAD pushed a commit to HeinrichAD/plantuml-server that referenced this issue Jul 19, 2023
headless OpenJDK does not refer `http_proxy` environment variable, so build image inside proxy will fail.
resolves plantuml#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant