Skip to content
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

Run Docker with Custom Options #363

Closed
907th opened this issue Jun 26, 2014 · 17 comments
Closed

Run Docker with Custom Options #363

907th opened this issue Jun 26, 2014 · 17 comments
Milestone

Comments

@907th
Copy link
Contributor

907th commented Jun 26, 2014

I broke my brain trying to understand why my custom image is running under root instead of ubuntu user. The issue. Finally I found that Drone uses root for all images except forbradrydzewski's ones. 😲

I think Drone should allow to specify a custom user for build in .drone.yml

@0xcaff
Copy link
Contributor

0xcaff commented Jun 27, 2014

All images will use root soon,

@907th
Copy link
Contributor Author

907th commented Jun 28, 2014

@caffinatedmonkey Ok, but having the ability to change the user is a big deal

@jeffutter
Copy link

+1 Some build related things (like bundler) don't like to be run as root. I would like to be able to specify the user when using my own docker image as a base for building.

@sarahkevinking
Copy link

+1 I tried to customize the bradrydzewski images. It was baffling that cloning the original image would cause the build to fail. Nice find.

@floatdrop
Copy link
Contributor

@bradrydzewski I want to implement achieve something like this - because we need to run build under teamcity (we have some gpg work to do). May be add option to .drone.yml (like user under image section)?

@bradrydzewski
Copy link
Contributor

@floatdrop we're probably going to expose more Docker customization in the future (#362) so it would be great to have something like this:

image: python
docker:
  user: teamcity
  net: host
  privileged: true

Thoughts about implementing as described above? At some point it could make sense to move image under the docker section, especially if we end up supporting vagrant, but I'd like to defer that to a later release:

docker:
  image: python
  user: teamcity
  net: host
  privileged: true

@floatdrop
Copy link
Contributor

@bradrydzewski will try, but first attempt to change manually root to teamcity in code failed with this output:

Not found

This will be not as straightforward as I thought.

@bradrydzewski
Copy link
Contributor

@floatdrop a quick workaround could be adduser and then su in your build script.

@floatdrop
Copy link
Contributor

@bradrydzewski thanks for the tip.

I have preconfigured image with teamcity user in it - so adduser is not necessary in my case. What should be mentioned - sudo -H -u teamcity is the command, that works for me (it will not change current directory, but will set $HOME to the right place - where gpg keys are). Also I added chmod -R 777 .. to grant access to teamcity user and debuild command (which build package in the parent directory).

Hope it will help some one, while docker options is under developing.

@codekoala
Copy link

@bradrydzewski has there been any work on the docker customization options? If not, I might take a stab at it.

@bradrydzewski
Copy link
Contributor

@codekoala yes some progress. I have a local branch that adds the docker section to the yaml as discussed above along with privileged mode. Should have something available this weekend. Would love some feedback if you're able to test

@codekoala
Copy link

Absolutely!
On Oct 2, 2014 11:28 PM, "Brad Rydzewski" notifications@github.com wrote:

@codekoala https://github.com/codekoala yes some progress. I have a
local branch that adds the docker section to the yaml as discussed above
along with privileged mode. Should have something available this weekend.
Would love some feedback if you're able to test


Reply to this email directly or view it on GitHub
#363 (comment).

@bradrydzewski bradrydzewski changed the title Allow to specify a user for build (feature request) Run Docker with Custom Options Oct 7, 2014
@bradrydzewski bradrydzewski added this to the v0.3 milestone Oct 7, 2014
This was referenced Oct 7, 2014
@bradrydzewski bradrydzewski modified the milestones: v0.4, v0.3 Oct 10, 2014
@bradrydzewski
Copy link
Contributor

@floatdrop just submitted #617 to include --net

@bradrydzewski
Copy link
Contributor

we've added the docker section to the yaml and many customization options. We are altering the Drone build process to use the default USER assigned to the image. We are tracking this change in #749 so I'm going to close this issue.

@907th
Copy link
Contributor Author

907th commented Mar 26, 2015

@bradrydzewski Thanks! Is new docker section documented anywhere? Can not find docs for it :(

@nardeas
Copy link

nardeas commented May 15, 2018

Still cannot find this anywhere in documentation. Any help here?

@one000mph
Copy link

Does this still exist in 0.8? It seems not...

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

9 participants