Closed SemenMartynov closed 6 years ago
And even after cloning to disk:
$ docker build -t validation-service . && docker run -t --rm -p 80:80 validation-service
Sending build context to Docker daemon 862.7 kB
Step 1/8 : FROM alpine:3.2
---> 3fa9f6bd8a5e
Step 2/8 : RUN apk --update add openjdk7-jre
---> Using cache
---> 7eff16f4637b
Step 3/8 : RUN apk add --no-cache bash git openssh
---> Using cache
---> 9cd143422f1d
Step 4/8 : WORKDIR /app
---> Using cache
---> d264350bd7cd
Step 5/8 : ADD . /app
---> 0df55eea0b53
Removing intermediate container 4c8a2ce73bf3
Step 6/8 : EXPOSE 80
---> Running in 9a1ffed71150
---> 69c4a6dc1f2a
Removing intermediate container 9a1ffed71150
Step 7/8 : ENV NAME World
---> Running in 74ad4a993404
---> 4c2589f605d6
Removing intermediate container 74ad4a993404
Step 8/8 : ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar /ValidatingService.jar
---> Running in 21ebe0175d76
---> 64e7d6679cb8
Removing intermediate container 21ebe0175d76
Successfully built 64e7d6679cb8
Error: Unable to access jarfile /ValidatingService.jar
Weird... will check
It should work this way, but it doesn't
$ docker build -t validation-service github.com/AleksanderBoldyrev/JSON_Val && docker run -t --rm -p 80:80 validation-service
Sending build context to Docker daemon 862.7 kB
Step 1/8 : FROM alpine:3.2
---> 3fa9f6bd8a5e
Step 2/8 : RUN apk --update add openjdk7-jre
---> Using cache
---> 7eff16f4637b
Step 3/8 : RUN apk add --no-cache bash git openssh
---> Using cache
---> 9cd143422f1d
Step 4/8 : WORKDIR /app
---> Using cache
---> d264350bd7cd
Step 5/8 : ADD . /app
---> be517795d3f4
Removing intermediate container 3d4e44d491b6
Step 6/8 : EXPOSE 80
---> Running in 5d3b08743f46
---> a3d3b1f68448
Removing intermediate container 5d3b08743f46
Step 7/8 : ENV NAME World
---> Running in 1189c47bdb34
---> c98c623bd80b
Removing intermediate container 1189c47bdb34
Step 8/8 : ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar /ValidatingService.jar
---> Running in cee2e19f9c78
---> 4aa77aa6b77e
Removing intermediate container cee2e19f9c78
Successfully built 4aa77aa6b77e
Error: Unable to access jarfile /ValidatingService.jar
Hi! Any news here?
I'm trying to run the app, but there is a problem with the path of generated jar. Today, I hope, I solve this issue
OK
$ docker build -t validation-service github.com/AleksanderBoldyrev/JSON_Val && docker run -t --rm -p 80:80 validation-service
Sending build context to Docker daemon 876.5 kB
Step 1/15 : FROM alpine:3.7
3.7: Pulling from library/alpine
2fdfe1cd78c2: Already exists
Digest: sha256:ccba511b1d6b5f1d83825a94f9d5b05528db456d9cf14a1ea1db892c939cda64
Status: Downloaded newer image for alpine:3.7
---> e21c333399e0
Step 2/15 : ENV LANG C.UTF-8
---> Running in ee54efcb709a
---> ff59c56a3595
Removing intermediate container ee54efcb709a
Step 3/15 : RUN { echo '#!/bin/sh'; echo 'set -e'; echo; echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home
---> Running in 57b1128c2517
---> 5c516efd6074
Removing intermediate container 57b1128c2517
Step 4/15 : ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
---> Running in 82ede85c47c8
---> 6a06eddb465b
Removing intermediate container 82ede85c47c8
Step 5/15 : ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
---> Running in 21a63937a5f6
---> ea708286f3f9
Removing intermediate container 21a63937a5f6
Step 6/15 : ENV JAVA_VERSION 8u151
---> Running in c1a4cfd13d23
---> 1fb0aaab2f73
Removing intermediate container c1a4cfd13d23
Step 7/15 : ENV JAVA_ALPINE_VERSION 8.151.12-r0
---> Running in 0007f4b574ad
---> 608285adc612
Removing intermediate container 0007f4b574ad
Step 8/15 : RUN set -x && apk add --no-cache openjdk8="$JAVA_ALPINE_VERSION" && [ "$JAVA_HOME" = "$(docker-java-home)" ]
---> Running in c83c0efa6331
+ apk add --no-cache openjdk8=8.151.12-r0
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/40) Installing libffi (3.2.1-r4)
(2/40) Installing libtasn1 (4.12-r2)
(3/40) Installing p11-kit (0.23.2-r2)
(4/40) Installing p11-kit-trust (0.23.2-r2)
(5/40) Installing ca-certificates (20171114-r0)
(6/40) Installing java-cacerts (1.0-r0)
(7/40) Installing libxau (1.0.8-r2)
(8/40) Installing libbsd (0.8.6-r1)
(9/40) Installing libxdmcp (1.1.2-r4)
(10/40) Installing libxcb (1.12-r1)
(11/40) Installing libx11 (1.6.5-r1)
(12/40) Installing libxcomposite (0.4.4-r1)
(13/40) Installing libxext (1.3.3-r2)
(14/40) Installing libxi (1.7.9-r1)
(15/40) Installing libxrender (0.9.10-r2)
(16/40) Installing libxtst (1.2.3-r1)
(17/40) Installing alsa-lib (1.1.4.1-r2)
(18/40) Installing libbz2 (1.0.6-r6)
(19/40) Installing libpng (1.6.34-r1)
(20/40) Installing freetype (2.8.1-r2)
(21/40) Installing libgcc (6.4.0-r5)
(22/40) Installing giflib (5.1.4-r1)
(23/40) Installing libjpeg-turbo (1.5.2-r0)
(24/40) Installing libstdc++ (6.4.0-r5)
(25/40) Installing openjdk8-jre-lib (8.151.12-r0)
(26/40) Installing java-common (0.1-r0)
(27/40) Installing krb5-conf (1.0-r1)
(28/40) Installing libcom_err (1.43.7-r0)
(29/40) Installing keyutils-libs (1.5.10-r0)
(30/40) Installing libverto (0.3.0-r0)
(31/40) Installing krb5-libs (1.15.2-r1)
(32/40) Installing lcms2 (2.8-r1)
(33/40) Installing nspr (4.17-r0)
(34/40) Installing sqlite-libs (3.21.0-r0)
(35/40) Installing nss (3.34.1-r0)
(36/40) Installing pcsc-lite-libs (1.8.22-r0)
(37/40) Installing lksctp-tools (1.0.17-r0)
(38/40) Installing openjdk8-jre-base (8.151.12-r0)
(39/40) Installing openjdk8-jre (8.151.12-r0)
(40/40) Installing openjdk8 (8.151.12-r0)
Executing busybox-1.27.2-r6.trigger
Executing ca-certificates-20171114-r0.trigger
Executing java-common-0.1-r0.trigger
OK: 100 MiB in 51 packages
+ docker-java-home
+ [ /usr/lib/jvm/java-1.8-openjdk = /usr/lib/jvm/java-1.8-openjdk ]
---> 02b9ae7a95dd
Removing intermediate container c83c0efa6331
Step 9/15 : RUN apk update && apk add ca-certificates && update-ca-certificates && apk add openssl
---> Running in 96bbcf6a0a7b
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-35-g1f6e64f5d4 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-34-g4caa398901 [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
OK: 9046 distinct packages available
OK: 100 MiB in 51 packages
WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping
(1/3) Installing libcrypto1.0 (1.0.2n-r0)
(2/3) Installing libssl1.0 (1.0.2n-r0)
(3/3) Installing openssl (1.0.2n-r0)
Executing busybox-1.27.2-r6.trigger
Executing ca-certificates-20171114-r0.trigger
OK: 103 MiB in 54 packages
---> 848bb5b12925
Removing intermediate container 96bbcf6a0a7b
Step 10/15 : WORKDIR /app
---> 58024c46ee8d
Removing intermediate container e4b22ba935ca
Step 11/15 : ADD . /app
---> a0a5a0a349b7
Removing intermediate container 4cf59284e446
Step 12/15 : RUN chmod 777 run.sh
---> Running in b24f6a85230f
---> 5dbfdaacc3fa
Removing intermediate container b24f6a85230f
Step 13/15 : RUN chmod +x run.sh
---> Running in 779c0750f362
---> 78e2cea571dc
Removing intermediate container 779c0750f362
Step 14/15 : EXPOSE 80
---> Running in e45a0712ddfc
---> 8ef749044441
Removing intermediate container e45a0712ddfc
Step 15/15 : CMD /bin/sh /app/run.sh
---> Running in 4e7325ddf153
---> 0f54e292b01d
Removing intermediate container 4e7325ddf153
Successfully built 0f54e292b01d
Connecting to central.maven.org (151.101.84.209:80)
json-simple-1.1.jar 100% |*******************************************************************************************************************************************************************| 16046 0:00:00 ETA
./src/main/java/com/alex/Settings.java:3: warning: StringList is internal proprietary API and may be removed in a future release
import com.sun.org.apache.xerces.internal.xs.StringList;
^
Note: ./src/main/java/com/alex/Core.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Creating server
Creating server thread
Trying to run server thread