-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
examples/gitserver image needs a valid non-root user #18912
Comments
See this document on how to build an image to properly work within OpenShift: https://docs.openshift.org/latest/creating_images/guidelines.html#openshift-specific-guidelines, Section "Support Arbitrary User IDs" |
@bparees we should move this into a separate repo and give it a real build process |
(and fix the issue) |
I might also request the Dockerfile use something a little lighter than the |
@phemmer it's monstrous but it's also already pulled to every openshift node in most cases, so it's pretty much free. |
The one caveat with that is that we're trying to use But this is mostly just a nitpick. It still works, just sucks up some disk & makes the build take longer. Or we can just have the management overhead of ensuring the tag we deploy matches the OpenShift version exactly. |
@openshift/sig-developer-experience |
looks like this has been fixed, maybe a pleasant side-effect of #19262? Feel free to reopen if you think your use-case is still not working $ oc create -f gitserver-ephemeral.yaml
deploymentconfig.apps.openshift.io "git" created
service "git" created
serviceaccount "git" created
route.route.openshift.io "git" created also pushing and pulling seems to work well oc pod & svc
git push$ git remote -v
openshift http://172.30.130.87:8080/ruby-hello-world.git (fetch)
openshift http://172.30.130.87:8080/ruby-hello-world.git (push)
origin https://github.com/openshift/ruby-hello-world.git (fetch)
origin https://github.com/openshift/ruby-hello-world.git (push)
$ git push openshift master
Counting objects: 296, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (187/187), done.
Writing objects: 100% (296/296), 49.31 KiB | 0 bytes/s, done.
Total 296 (delta 95), reused 296 (delta 95)
remote: --> Found Docker image 77b9ffb (47 hours old) from Docker Hub for "centos/ruby-22-centos7"
remote:
remote: Ruby 2.2
remote: --------
remote: Ruby 2.2 available as container is a base platform for building and running various Ruby 2.2 applications and frameworks. Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible.
remote:
remote: Tags: builder, ruby, ruby22
remote:
remote: * An image stream will be created as "ruby-22-centos7:latest" that will track the source image
remote: * A Docker build using source code from http://git:8080/ruby-hello-world.git will be created
remote: * The resulting image will be pushed to image stream "ruby-hello-world:latest"
remote: * Every time "ruby-22-centos7:latest" changes a new build will be triggered
remote: * WARNING: this source repository may require credentials.
remote: Create a secret with your git credentials and use 'set build-secret' to assign it to the build config.
remote: * This image will be deployed in deployment config "ruby-hello-world"
remote: * Port 8080 will be load balanced by service "ruby-hello-world"
remote: * Other containers can access this service through the hostname "ruby-hello-world"
remote:
remote: --> Creating resources ...
remote: imagestream "ruby-22-centos7" created
remote: imagestream "ruby-hello-world" created
remote: buildconfig "ruby-hello-world" created
remote: deploymentconfig "ruby-hello-world" created
remote: service "ruby-hello-world" created
remote: --> Success
remote: Build scheduled, use 'oc logs -f bc/ruby-hello-world' to track its progress.
remote: Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
remote: 'oc expose svc/ruby-hello-world'
remote: Run 'oc status' to view your app.
To http://172.30.130.87:8080/ruby-hello-world.git
* [new branch] master -> master git pull$ git clone http://172.30.130.87:8080/ruby-hello-world.git
Cloning into 'ruby-hello-world'...
remote: Counting objects: 296, done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 296 (delta 95), reused 296 (delta 95)
Receiving objects: 100% (296/296), 49.31 KiB | 0 bytes/s, done.
Resolving deltas: 100% (95/95), done. |
Version
Steps To Reproduce
Follow the directions in https://github.com/openshift/origin/tree/master/examples/gitserver
oc create -f gitserver-ephemeral.yaml
Current Result
Expected Result
success
Additional Information
This is because the
Dockerfile
is not adding a valid user, so the container launches with a user ID in the restricted range, which doesn't exist within the container.The text was updated successfully, but these errors were encountered: