8000 werf cr login does not work with the docker registry image · Issue #6667 · werf/werf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

w 8000 erf cr login does not work with the docker registry image #6667

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

Open
1 task done
chasinglogic opened this issue Feb 27, 2025 · 3 comments
Open
1 task done

werf cr login does not work with the docker registry image #6667

chasinglogic opened this issue Feb 27, 2025 · 3 comments

Comments

@chasinglogic
Copy link
chasinglogic commented Feb 27, 2025

Before proceeding

  • I didn't find a similar issue

Version

2.29.0

How to reproduce

  1. On my local laptops I setup the docker registry with this command:
docker run -d   -p 5000:5000   --name registry   -v registry-data:/var/lib/registry   --restart always   registry:2
  1. I am able to push images to this registry using docker push:
(kube: docker-desktop) ~/tmp/werf-playground main λ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
6e771e15690e: Download complete
Digest: sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview alpine
(kube: docker-desktop) ~/tmp/werf-playground main λ docker tag alpine localhost:5000/alpine
(kube: docker-desktop) ~/tmp/werf-playground main λ docker push localhost:5000/alpine
Using default tag: latest
The push refers to repository [localhost:5000/alpine]
6e771e15690e: Pushed
latest: digest: sha256:757d680068d77be46fd1ea20fb21db16f150468c5e7079a08a2e4705aec096ac size: 1025

i Info → Not all multiplatform-content is present and only the available single-platform image was pushed
         sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c -> sha256:757d680068d77be46fd1ea20fb21db16f150468c5e7079a08a2e4705aec096ac
(kube: docker-desktop) ~/tmp/werf-playground main λ
  1. When I run werf cr login --help I see this example for insecure registries:
# Login into insecure registry (over http)
werf cr login --insecure-registry registry.example.com
  1. Run werf cr login --insecure-registry localhost:5000

Result

When I run that I get the error: Error: provide --username

If I try running --insecure-registry with a bogus --username and --password flag (--password is also required if you simply provide --username alone) I get this error:

(kube: docker-desktop) ~/tmp/werf-playground main λ werf cr login -u username -p token --insecure-registry localhost:5000
time="2025-02-27T09:13:44Z" level=info msg="Error logging in to endpoint, trying next endpoint" error="Get \"https://localhost:5000/v2/\": http: server gave HTTP response to HTTPS client"
Error: unable to store credentials: unable to store credentials: error storing credentials - err: exit status 1, out: `not implemented`

It seems to me that --insecure-registry clearly doesn't behave as expected or the help information is out of date. If it's simply the help is out of date I don't see a way that local insecure registries can be supported.

Expected result

I expected werf to be able to work with a locally running registry for testing purposes.

Additional information

No response

@alexey-igrychev
Copy link
Member

Hello @chasinglogic.

When working with a locally running registry, there is no need to perform additional actions such as werf cr login. If docker push works, then werf build --repo localhost:5000/test should also work correctly.

The behavior of werf cr login seems unusual; we will take a look.

@chasinglogic
Copy link
Author
chasinglogic commented Mar 18, 2025

@alexey-igrychev I did try werf build first and I get this (same with or without --insecure-registry flag added to the build command):

(kube: dev) ~/tmp/werf-playground main λ werf build --repo localhost:5000/werf-playground
Version: 2.32.1
Using werf config render file: /private/var/folders/q_/nztgfh9n7z583wsmcl3tfv9m0000gr/T/werf-config-render-2517864295

┌ 🛳️  image app
panic: expected stage "dockerfile" content digest label to be set!

goroutine 1 [running]:
github.com/werf/werf/v2/pkg/build.(*BuildPhase).calculateStage(0x14000c36780, {0x108aac338, 0x14000e9ef60}, 0x14000bfa300, {0x108ad8e60, 0x14000726aa0})
        github.com/werf/werf/v2/pkg/build/build_phase.go:986 +0xb44
github.com/werf/werf/v2/pkg/build.(*BuildPhase).onImageStage(0x14000c36780, {0x108aac338, 0x14000e9ef60}, 0x14000bfa300, {0x108ad8e60, 0x14000726aa0})
        github.com/werf/werf/v2/pkg/build/build_phase.go:744 +0xe8
github.com/werf/werf/v2/pkg/build.(*BuildPhase).OnImageStage.func1(0x14000bfa300, {0x108ad8e60, 0x14000726aa0}, 0x20?)
        github.com/werf/werf/v2/pkg/build/build_phase.go:717 +0x64
github.com/werf/werf/v2/pkg/build.(*StagesIterator).OnImageStage(0x14000437e40, {0x108aac338, 0x14000e9ef60}, 0x14000bfa300, {0x108ad8e60, 0x14000726aa0}, 0x14000aaebf8)
        github.com/werf/werf/v2/pkg/build/stages_iterator.go:58 +0x214
github.com/werf/werf/v2/pkg/build.(*BuildPhase).OnImageStage(0x140004f6210?, {0x108aac338?, 0x14000e9ef60?}, 0x14000c25a10?, {0x108ad8e60?, 0x14000726aa0?})
        github.com/werf/werf/v2/pkg/build/build_phase.go:713 +0x4c
github.com/werf/werf/v2/pkg/build.(*Conveyor).doImage.func2()
        github.com/werf/werf/v2/pkg/build/conveyor.go:726 +0x720
github.com/werf/logboek/internal/stream.(*Stream).logProcess.func1()
        github.com/werf/logboek@v0.6.1/internal/stream/process.go:150 +0x24
github.com/werf/logboek/internal/stream.(*Stream).logProcess(0x140003be0d8, {0x14000630d50?, 0x38?}, 0x14000c24c90, 0x14000437d80)
        github.com/werf/logboek@v0.6.1/internal/stream/process.go:157 +0x19c
github.com/werf/logboek/internal/stream.(*LogProcess).DoError(0x14000437d00, 0x14000437d80)
        github.com/werf/logboek@v0.6.1/internal/stream/process_types.go:201 +0xa0
github.com/werf/werf/v2/pkg/build.(*Conveyor).doImage(0x14000aaefe8?, {0x108aac338, 0x14000e9ef60}, 0x14000bfa300, {0x1400081d530, 0x1, 0x1})
        github.com/werf/werf/v2/pkg/build/conveyor.go:708 +0x164
github.com/werf/werf/v2/pkg/build.(*Conveyor).doImages(0x14000bfa180, {0x108aac338, 0x14000e9ef60}, {0x1400081d530, 0x1, 0x1}, 0xc8?)
        github.com/werf/werf/v2/pkg/build/conveyor.go:609 +0xcc
github.com/werf/werf/v2/pkg/build.(*Conveyor).runPhases(0x14000bfa180, {0x108aac338, 0x14000e9ef60}, {0x1400081d530, 0x1, 0x1}, 0x1)
        github.com/werf/werf/v2/pkg/build/conveyor.go:584 +0x204
github.com/werf/werf/v2/pkg/build.(*Conveyor).Build(0x14000bfa180, {0x108aac338, 0x14000e9ef60}, {{{0x0, 0x0}, 0x0, 0x0}, {{0x0, 0x0, 0x0}}, ...})
        github.com/werf/werf/v2/pkg/build/conveyor.go:544 +0x1d8
github.com/werf/werf/v2/cmd/werf/build.run.func1(0x1?)
        github.com/werf/werf/v2/cmd/werf/build/main.go:217 +0x44
github.com/werf/werf/v2/cmd/werf/build.run.(*ConveyorWithRetryWrapper).WithRetryBlock.func2()
        github.com/werf/werf/v2/pkg/build/conveyor_with_retry.go:57 +0x108
github.com/werf/werf/v2/pkg/storage/manager.RetryOnUnexpectedStagesStorageState({0x0?, 0x0?}, {0x0?, 0x0?}, 0x14000aaf8f0)
        github.com/werf/werf/v2/pkg/storage/manager/storage_manager.go:109 +0x30
github.com/werf/werf/v2/pkg/build.(*ConveyorWithRetryWrapper).WithRetryBlock(...)
        github.com/werf/werf/v2/pkg/build/conveyor_with_retry.go:43
github.com/werf/werf/v2/cmd/werf/build.run({0x108aac338, 0x14000e9ef60}, {0x108add8b0, 0x10ad425a8}, {0x108abe160, 0x140009ad680}, {0x1400044eb60, 0x0, 0x2})
        github.com/werf/werf/v2/cmd/werf/build/main.go:216 +0x5a8
github.com/werf/werf/v2/cmd/werf/build.runMain({0x108aac338, 0x1400109acf0}, {0x1400044eb60, 0x0, 0x2})
        github.com/werf/werf/v2/cmd/werf/build/main.go:166 +0x308
github.com/werf/werf/v2/cmd/werf/build.NewCmd.func1.1()
        github.com/werf/werf/v2/cmd/werf/build/main.go:57 +0x30
github.com/werf/werf/v2/cmd/werf/common.LogRunningTime(0x14001007b90)
        github.com/werf/werf/v2/cmd/werf/common/common.go:1629 +0x38
github.com/werf/werf/v2/cmd/werf/build.NewCmd.func1(0x1400027d808, {0x1400044eb60, 0x0, 0x2})
        github.com/werf/werf/v2/cmd/werf/build/main.go:56 +0x138
github.com/werf/werf/v2/cmd/werf/root.SetupTelemetryInit.func1(0x1400027d808, {0x1400044eb60, 0x0, 0x2})
        github.com/werf/werf/v2/cmd/werf/root/root.go:251 +0xcc
github.com/spf13/cobra.(*Command).execute(0x1400027d808, {0x1400044eb40, 0x2, 0x2})
        github.com/spf13/cobra@v1.8.0/command.go:983 +0x830
github.com/spf13/cobra.(*Command).ExecuteC(0x14000fa6008)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1039
main.main()
        github.com/werf/werf/v2/cmd/werf/main.go:47 +0x150

6AD6
@alexey-igrychev
Copy link
Member

This issue was fixed in PR #6675. Try using a different container registry repository or invalidate the existing cache by setting build.cacheVersion in werf.yml (see docs).

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

No branches or pull requests

2 participants
0