-
Notifications
You must be signed in to change notification settings - Fork 977
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
Useless line in Dockerfile-build #3446
Comments
Hi there! |
Ok yeah maybe it's not completely useless but as you don't have a go.mod or go.* file there is no file copy in the internal/httpclient/ folder in the build image. So for me, this line actually has no effect on the build even if there's no error or warning. Docker doesn't display an error if it can't find the source files to copy to the destination folder, otherwise Podman displays an error on this exception. Using the following cmd from Podman(equivalent to the Docker cmd): podman build -t ory-kratos . -f .docker/Dockerfile-build I've got the following output: WARN[0000] missing "VERSION" build argument. Try adding "--build-arg VERSION=<VALUE>" to the command line
WARN[0000] missing "COMMIT" build argument. Try adding "--build-arg COMMIT=<VALUE>" to the command line
WARN[0000] missing "BUILD_DATE" build argument. Try adding "--build-arg BUILD_DATE=<VALUE>" to the command line
[1/2] STEP 1/16: FROM docker.io/golang:1.19-bullseye AS builder
[1/2] STEP 2/16: RUN apt-get update && apt-get upgrade -y && mkdir -p /var/lib/sqlite
--> Using cache 3139358eae385eecc386ac74054c4ed8af8e14a647557e8fceea658cf1f1f87e
--> 3139358eae3
^[[1;2D[1/2] STEP 3/16: WORKDIR /go/src/github.com/ory/kratos
--> Using cache 2e5654b8ef440d4110f026450926b3729272f1fa89e0ebfd583d1738cca5631c
--> 2e5654b8ef4
[1/2] STEP 4/16: COPY go.mod go.mod
--> Using cache d5b9af88127635d6d01823961c281dba87e9784c169a14ae8f75b28a84a3fb8a
--> d5b9af88127
[1/2] STEP 5/16: COPY go.sum go.sum
--> Using cache 91641f5aef6846de483a5c2f54234ae012864481f54690d82829bb0b1737fe3b
--> 91641f5aef6
[1/2] STEP 6/16: COPY internal/httpclient/go.* internal/httpclient/
Error: building at STEP "COPY internal/httpclient/go.* internal/httpclient/": checking on sources under "/home/jorgagu/ory/kratos": Rel: can't make relative to /home/jorgagu/ory/kratos; copier: stat: ["/internal/httpclient/go.*"]: no such file or directory And the Podman build command fails at this point, whereas Docker build doesn't care about making a copy on non-existent files. UPDATE: I've added the reproduction steps and the output result to the original message. |
@aeneasr could you take a look here? Seems to me like we either moved some code (go.mod) from the httpclient, or we should modify the dockerfile to copy the whole directory |
@aeneasr did you have time to check this? |
This is also an issue for Skaffold. As a test I simply removed the line and so far everything is fine. |
Preflight checklist
Ory Network Project
No response
Describe the bug
While I'm using Podman to build my custom Kratos image locally to test something, I get an error telling me that the https://github.com/ory/kratos/blob/master/.docker/Dockerfile-build#L12 line couldn't find the files to copy so I think it's a bad copy or useless code now.
Perhaps @Demonsthere could confirm this point?
Reproducing the bug
golang:1.19-bullseye
like this:FROM docker.io/golang:1.19-bullseye AS builder
podman build -t ory-kratos . -f .docker/Dockerfile-build
Relevant log output
Relevant configuration
No response
Version
v1.0.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Podman
Additional Context
No response
The text was updated successfully, but these errors were encountered: