Last active
September 14, 2022 02:27
-
-
Save andreybpanfilov/a22cf9a200d1960dccadf0398ea7ea3d to your computer and use it in GitHub Desktop.
Unable to download Java dependencies with Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM eclipse-temurin:18.0.2.1_1-jdk-focal AS builder | |
ENV APP=/home/meapi/app | |
WORKDIR $APP | |
COPY .mvn .mvn | |
COPY ./mvnw pom.xml ./ | |
RUN ./mvnw -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies | |
COPY src src | |
RUN ./mvnw -o package -DskipTests | |
FROM eclipse-temurin:18.0.2.1_1-jre-focal as dev | |
RUN addgroup --system meapi && adduser --system --group meapi | |
ENV spring_profiles_active=development | |
ENV APP=/home/meapi/app | |
WORKDIR $APP | |
RUN chown -R meapi:meapi $APP | |
USER meapi | |
COPY --chown=meapi:meapi --from=builder $APP/target/*.jar $APP/app.jar | |
EXPOSE 8080 | |
ENTRYPOINT [ "java", "-jar", "/usr/meapi/app/app.jar" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker build . | |
[+] Building 473.0s (16/17) | |
=> [internal] load build definition from Dockerfile 0.0s | |
=> => transferring dockerfile: 668B 0.0s | |
=> [internal] load .dockerignore 0.0s | |
=> => transferring context: 2B 0.0s | |
=> [internal] load metadata for docker.io/library/eclipse-temurin:18.0.2.1_1-jre-focal 1.1s | |
=> [internal] load metadata for docker.io/library/eclipse-temurin:18.0.2.1_1-jdk-focal 1.1s | |
=> [builder 1/7] FROM docker.io/library/eclipse-temurin:18.0.2.1_1-jdk-focal@sha256:edfc6473258c0cc5eca3209bbb500aa859ff67f2f6e2325553673c42a3801934 31.3s | |
=> => resolve docker.io/library/eclipse-temurin:18.0.2.1_1-jdk-focal@sha256:edfc6473258c0cc5eca3209bbb500aa859ff67f2f6e2325553673c42a3801934 0.0s | |
=> => sha256:edfc6473258c0cc5eca3209bbb500aa859ff67f2f6e2325553673c42a3801934 1.21kB / 1.21kB 0.0s | |
=> => sha256:002783d6d8d5419c35b4bf2ad1e73bef302ef9c18d3b61c542b2e914666aaf08 1.16kB / 1.16kB 0.0s | |
=> => sha256:ba8f419a3848b041174dae342a9fdb9d50385f65935fe63534cdebf35c2f773e 5.61kB / 5.61kB 0.0s | |
=> => sha256:675920708c8bf10fbd02693dc8f43ee7dbe0a99cdfd55e06e6f1a8b43fd08e3f 28.57MB / 28.57MB 7.1s | |
=> => sha256:74b5511391049b7fe5160b78ebae36e40eef43734a07d246dc389dff107a1d22 20.10MB / 20.10MB 7.3s | |
=> => sha256:3f944fce1a2cc7f7b983ada5353c814d11594753358f3eb2d7ad5fd34942cdb1 193.57MB / 193.57MB 26.6s | |
=> => sha256:dd99c338a27f664f5b35e333203c1318b5f6742385af33c86b18cdd5029bbe27 176B / 176B 8.5s | |
=> => extracting sha256:675920708c8bf10fbd02693dc8f43ee7dbe0a99cdfd55e06e6f1a8b43fd08e3f 1.3s | |
=> => extracting sha256:74b5511391049b7fe5160b78ebae36e40eef43734a07d246dc389dff107a1d22 1.1s | |
=> => extracting sha256:3f944fce1a2cc7f7b983ada5353c814d11594753358f3eb2d7ad5fd34942cdb1 4.5s | |
=> => extracting sha256:dd99c338a27f664f5b35e333203c1318b5f6742385af33c86b18cdd5029bbe27 0.0s | |
=> [dev 1/5] FROM docker.io/library/eclipse-temurin:18.0.2.1_1-jre-focal@sha256:3326668f30f70edfb31ebf557877f5c0284131fb1db695059ffef847adcf1aa9 18.7s | |
=> => resolve docker.io/library/eclipse-temurin:18.0.2.1_1-jre-focal@sha256:3326668f30f70edfb31ebf557877f5c0284131fb1db695059ffef847adcf1aa9 0.0s | |
=> => sha256:74b5511391049b7fe5160b78ebae36e40eef43734a07d246dc389dff107a1d22 20.10MB / 20.10MB 7.3s | |
=> => sha256:3326668f30f70edfb31ebf557877f5c0284131fb1db695059ffef847adcf1aa9 1.21kB / 1.21kB 0.0s | |
=> => sha256:81ffa163e5d7b3c0117bd49455d63601878fe2688ab888a8131c688d7eb95a92 1.16kB / 1.16kB 0.0s | |
=> => sha256:0115e1e4fa329614bce77b9e32d098f5a77521e29b77c6538f9519c542663da5 5.68kB / 5.68kB 0.0s | |
=> => sha256:675920708c8bf10fbd02693dc8f43ee7dbe0a99cdfd55e06e6f1a8b43fd08e3f 28.57MB / 28.57MB 7.1s | |
=> => extracting sha256:675920708c8bf10fbd02693dc8f43ee7dbe0a99cdfd55e06e6f1a8b43fd08e3f 1.3s | |
=> => sha256:13fbf917f2878f5c6f2f891673bf7948b5bcdfaecfcc0e080f926d39abc9f0dd 46.68MB / 46.68MB 16.7s | |
=> => sha256:f42867ca5de4ec8198ebe46af2ed2b5517c0bd7248b5e92f3759157d47ead301 161B / 161B 9.1s | |
=> => extracting sha256:74b5511391049b7fe5160b78ebae36e40eef43734a07d246dc389dff107a1d22 463.0s | |
=> => extracting sha256:13fbf917f2878f5c6f2f891673bf7948b5bcdfaecfcc0e080f926d39abc9f0dd 1.8s | |
=> => extracting sha256:f42867ca5de4ec8198ebe46af2ed2b5517c0bd7248b5e92f3759157d47ead301 0.0s | |
=> [internal] load build context 0.0s | |
=> => transferring context: 71.01kB 0.0s | |
=> [dev 2/5] RUN addgroup --system meapi && adduser --system --group meapi 1.2s | |
=> [dev 3/5] WORKDIR /home/meapi/app 0.0s | |
=> [dev 4/5] RUN chown -R meapi:meapi /home/meapi/app 0.4s | |
=> [builder 2/7] WORKDIR /home/meapi/app 0.4s | |
=> [builder 3/7] COPY .mvn .mvn 0.0s | |
=> [builder 4/7] COPY ./mvnw pom.xml ./ 0.0s | |
=> [builder 5/7] RUN ./mvnw -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies 435.5s | |
=> [builder 6/7] COPY src src 0.0s | |
=> ERROR [builder 7/7] RUN ./mvnw -o package -DskipTests 4.5s | |
------ | |
> [builder 7/7] RUN ./mvnw -o package -DskipTests: | |
#16 2.091 [INFO] Scanning for projects... | |
#16 2.384 [INFO] | |
#16 2.384 [INFO] ---------------------------< com.me:me-api >---------------------------- | |
#16 2.390 [INFO] Building me-api 0.0.1-SNAPSHOT | |
#16 2.395 [INFO] --------------------------------[ jar ]--------------------------------- | |
#16 3.120 [INFO] | |
#16 3.120 [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ me-api --- | |
#16 3.398 [INFO] Using 'UTF-8' encoding to copy filtered resources. | |
#16 3.401 [INFO] Using 'UTF-8' encoding to copy filtered properties files. | |
#16 3.406 [INFO] skip non existing resourceDirectory /home/meapi/app/src/main/resources | |
#16 3.410 [INFO] skip non existing resourceDirectory /home/meapi/app/src/main/resources | |
#16 3.416 [INFO] | |
#16 3.417 [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ me-api --- | |
#16 3.593 [INFO] No sources to compile | |
#16 3.596 [INFO] | |
#16 3.596 [INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ me-api --- | |
#16 3.610 [INFO] Using 'UTF-8' encoding to copy filtered resources. | |
#16 3.612 [INFO] Using 'UTF-8' encoding to copy filtered properties files. | |
#16 3.615 [INFO] skip non existing resourceDirectory /home/meapi/app/src/test/resources | |
#16 3.618 [INFO] | |
#16 3.618 [INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ me-api --- | |
#16 3.626 [INFO] No sources to compile | |
#16 3.626 [INFO] | |
#16 3.627 [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ me-api --- | |
#16 3.756 [INFO] Tests are skipped. | |
#16 3.757 [INFO] | |
#16 3.757 [INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) @ me-api --- | |
#16 4.004 [WARNING] JAR will be empty - no content was marked for inclusion! | |
#16 4.035 [INFO] Building jar: /home/meapi/app/target/me-api-0.0.1-SNAPSHOT.jar | |
#16 4.102 [INFO] | |
#16 4.102 [INFO] --- spring-boot-maven-plugin:2.7.0:repackage (repackage) @ me-api --- | |
#16 4.370 [INFO] ------------------------------------------------------------------------ | |
#16 4.372 [INFO] BUILD FAILURE | |
#16 4.373 [INFO] ------------------------------------------------------------------------ | |
#16 4.376 [INFO] Total time: 2.324 s | |
#16 4.377 [INFO] Finished at: 2022-09-14T02:26:46Z | |
#16 4.378 [INFO] ------------------------------------------------------------------------ | |
#16 4.380 [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:repackage (repackage) on project me-api: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.7.0:repackage failed: Unable to find main class -> [Help 1] | |
#16 4.382 [ERROR] | |
#16 4.383 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. | |
#16 4.385 [ERROR] Re-run Maven using the -X switch to enable full debug logging. | |
#16 4.386 [ERROR] | |
#16 4.386 [ERROR] For more information about the errors and possible solutions, please read the following articles: | |
#16 4.388 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException | |
------ | |
executor failed running [/bin/sh -c ./mvnw -o package -DskipTests]: exit code: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-parent</artifactId> | |
<version>2.7.0</version> | |
<relativePath/> <!-- lookup parent from repository --> | |
</parent> | |
<groupId>com.me</groupId> | |
<artifactId>me-api</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>me-api</name> | |
<description>ME API</description> | |
<properties> | |
<java.version>11</java.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-web</artifactId> | |
<exclusions> | |
<exclusion> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-tomcat</artifactId> | |
</exclusion> | |
</exclusions> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-jetty</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-validation</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<optional>true</optional> | |
</dependency> | |
<dependency> | |
<groupId>org.liquibase</groupId> | |
<artifactId>liquibase-core</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-actuator</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.springdoc</groupId> | |
<artifactId>springdoc-openapi-ui</artifactId> | |
<version>1.6.8</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-test</artifactId> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-data-jpa</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>mysql</groupId> | |
<artifactId>mysql-connector-java</artifactId> | |
<scope>runtime</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.github.ulisesbocchio</groupId> | |
<artifactId>jasypt-spring-boot-starter</artifactId> | |
<version>2.0.0</version> | |
</dependency> | |
<dependency> | |
<groupId>com.h2database</groupId> | |
<artifactId>h2</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.mapstruct</groupId> | |
<artifactId>mapstruct</artifactId> | |
<version>1.5.1.Final</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<configuration> | |
<excludes> | |
<exclude> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
</exclude> | |
</excludes> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.7.0</version> | |
<configuration> | |
<source>11</source> <!-- depending on your project. In this example, Java 11 is used --> | |
<target>11</target> <!-- depending on your project. In this example, Java 11 is used --> | |
<annotationProcessorPaths> | |
<path> | |
<groupId>org.mapstruct</groupId> | |
<artifactId>mapstruct-processor</artifactId> | |
<version>1.5.1.Final</version> | |
</path> | |
<path> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<version>1.18.24</version> | |
</path> | |
<path> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok-mapstruct-binding</artifactId> | |
<version>0.1.0</version> | |
</path> | |
<!-- other annotation processors --> | |
</annotationProcessorPaths> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment