Skip to content

Enable referring a private registry in gitpod Dockerfile #10204

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

Closed
princerachit opened this issue May 24, 2022 · 1 comment
Closed

Enable referring a private registry in gitpod Dockerfile #10204

princerachit opened this issue May 24, 2022 · 1 comment
Labels
meta: stale This issue/PR is stale and will be closed soon

Comments

@princerachit
Copy link
Contributor

princerachit commented May 24, 2022

Is your feature request related to a problem? Please describe

I want to use a private registry in my gitpod dockerfile.

Describe the behaviour you'd like

I want my gitpod config to look like the following:

image:
  file: gitpod.Dockerfile

and the contents of gitpod.Dockerfile to look like this:

FROM registry.provider.com/project-base:v1

RUN apt-get install xxx
..
..

When I open my repo I expect image build to work and start a new workspace.

Describe alternatives you've considered

NA

Additional context

With existing code at the time of creating this issue I see the following error in imagebuild pod logs"

{
sudo -E /app/bob build
}; exit
bash-5.1$ {
> sudo -E /app/bob build
> }; exit
{"level":"debug","message":"buildkitd started","serviceContext":{"service":"bob","version":""},"severity":"DEBUG","stderr":"/tmp/buildkitd_stderr1507424168","stdout":"/tmp/buildkitd_stdout734526385","time":"2022-05-24T06:33:00Z"}
{"attempt":0,"level":"debug","message":"attempting to connect to buildkitd","serviceContext":{"service":"bob","version":""},"severity":"DEBUG","time":"2022-05-24T06:33:00Z"}
{"attempt":1,"level":"debug","message":"attempting to connect to buildkitd","serviceContext":{"service":"bob","version":""},"severity":"DEBUG","time":"2022-05-24T06:33:01Z"}
{"level":"info","message":"building base image","serviceContext":{"service":"bob","version":""},"severity":"INFO","time":"2022-05-24T06:33:01Z"}
{"level":"info","message":"waiting for build context","serviceContext":{"service":"bob","version":""},"severity":"INFO","time":"2022-05-24T06:33:01Z"}
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from gitpod.Dockerfile
#2 transferring dockerfile: 132B done
#2 DONE 0.0s

#3 [internal] load metadata for registry.gitlab.com/prince41/testproj/go:latest
#3 ERROR: failed to authorize: failed to fetch anonymous token: unexpected status: 403 Forbidden
------
 > [internal] load metadata for registry.gitlab.com/prince41/testproj/go:latest:
------
gitpod.Dockerfile:1
--------------------
   1 | >>> FROM registry.gitlab.com/prince41/testproj/go:latest
   2 |     
   3 |     RUN touch /tmp/abc && echo "done"
--------------------
error: failed to solve: failed to fetch anonymous token: unexpected status: 403 Forbidden
{"@type":"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent","command":"build","error":"exit status 1","level":"error","message":"build failed","serviceContext":{"service":"bob","version":""},"severity":"ERROR","time":"2022-05-24T06:33:01Z"}
exit

Error: headless task failed: exit status 1

Same error displayed in the browser:

image

Related PRs and Code

  • Support for private registry was added in this PR. It also says that you cannot refer to private registry in the dockerfile.
  • We probably had a mini scoped version of this feature when we used to have gitpod layer. The gitpod layer was removed and the corresponding variables were renamed to be more generic. However, the code to support it is missing in image-builder-mk3 I believe. i.e. setting appropriate env vars such as BOB_WSLAYER_AUTH
@princerachit princerachit changed the title Refer a private registry in gitpod Dockerfile Enable referring a private registry in gitpod Dockerfile May 24, 2022
@stale
Copy link

stale bot commented Sep 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Sep 24, 2022
@stale stale bot closed this as completed Oct 19, 2022
@stale stale bot moved this to Awaiting Deployment in 🌌 Workspace Team Oct 19, 2022
@sagor999 sagor999 moved this from Awaiting Deployment to In Validation in 🌌 Workspace Team Oct 19, 2022
@sagor999 sagor999 moved this from In Validation to Done in 🌌 Workspace Team Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: stale This issue/PR is stale and will be closed soon
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant