Após criar o Dockerfile, ao executar o docker build
(docker build -t e1000son/codechella:1.0 .) recebo o seguinte erro:
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref mwm3numzndywniqjj345f4y5j::oothkj1we2826ko4n6fjytth3: "/.mvn": not found
❯ docker build -t e1000son/codechella:1.0 .
[+] Building 1.4s (11/20) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 698B 0.0s
=> WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1) 0.0s
=> [internal] load metadata for docker.io/library/eclipse-temurin:21-jre-alpine 1.1s
=> [internal] load metadata for docker.io/library/eclipse-temurin:21-jdk-alpine 1.1s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [builder 1/9] FROM docker.io/library/eclipse-temurin:21-jdk-alpine@sha256:4909fb9ab52e3ce1488cc6e6063da71a0f9f9833420cc254fe03bbe25daec9e0 0.2s
=> => resolve docker.io/library/eclipse-temurin:21-jdk-alpine@sha256:4909fb9ab52e3ce1488cc6e6063da71a0f9f9833420cc254fe03bbe25daec9e0 0.0s
=> => sha256:7d061b3c52fbe2566fade57c090519f152f4d1f34b92c4b11e8483dac15082f7 1.05MB / 157.78MB 0.1s
=> => sha256:b3adb1b361694716f735538e25636db9c915b45c870e744223f3d3020d515c1c 1.05MB / 22.95MB 0.1s
=> => sha256:da9db072f522755cbeb85be2b3f84059b70571b229512f1571d9217b77e1087f 0B / 3.62MB 0.1s
=> [internal] load build context 0.1s
=> => transferring context: 13.37kB 0.1s
=> [stage-1 1/6] FROM docker.io/library/eclipse-temurin:21-jre-alpine@sha256:2a0bbb1db6d8db42c66ed00c43d954cf458066cc37be12b55144781da7864fdf 0.2s
=> => resolve docker.io/library/eclipse-temurin:21-jre-alpine@sha256:2a0bbb1db6d8db42c66ed00c43d954cf458066cc37be12b55144781da7864fdf 0.0s
=> => sha256:b2e2ff43196970b1cf8f1216bc83e626ec1d82f0d494ef8e0ff3e3a87519fddc 0B / 2.28kB 0.1s
=> CANCELED [builder 2/9] WORKDIR application 0.0s
=> CACHED [builder 3/9] COPY mvnw . 0.0s
=> ERROR [builder 4/9] COPY .mvn .mvn 0.0s
=> CANCELED [stage-1 2/6] WORKDIR application 0.0s
------
> [builder 4/9] COPY .mvn .mvn:
------
3 warnings found (use --debug to expand):
- FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
- WorkdirRelativePath: Relative workdir "application" can have unexpected results if the base image changes (line 2)
- WorkdirRelativePath: Relative workdir "application" can have unexpected results if the base image changes (line 14)
Dockerfile:4
--------------------
2 | WORKDIR application
3 | COPY mvnw .
4 | >>> COPY .mvn .mvn
5 | COPY pom.xml .
6 | COPY src src
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref mwm3numzndywniqjj345f4y5j::oothkj1we2826ko4n6fjytth3: "/.mvn": not found
Dockerfile:
FROM eclipse-temurin:21-jdk-alpine as builder
WORKDIR application
...
FROM eclipse-temurin:21-jre-alpine
WORKDIR application
...