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

Test and document binarySource=docker with Renovate image #3153

Closed
rarkins opened this issue Feb 2, 2019 · 30 comments
Closed

Test and document binarySource=docker with Renovate image #3153

rarkins opened this issue Feb 2, 2019 · 30 comments
Assignees

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 2, 2019

Need to map Docker sock into container first so that other containers can be run as siblings. It should work for composer, pipenv, go modules. Then document in the self hosting doc.

@Dmitry9

This comment has been minimized.

@rarkins

This comment has been minimized.

@Dmitry9

This comment has been minimized.

@rarkins

This comment has been minimized.

@rarkins

This comment has been minimized.

@Dmitry9

This comment has been minimized.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 26, 2019

This works for me on Mac: docker run --rm --user $UID -w pwd-vpwd:pwd -v /tmp:/tmp -v /var/run/docker.sock:/var/run/docker.sock renovate/renovate:slim owner/repo. Authentication is contained within a config.js in pwd but could also be passed via env.

It's essential that /tmp:/tmp is a mirror, e.g. /my/tmp:/tmp would not work.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 26, 2019

Cc @viceice

@viceice
Copy link
Member

viceice commented Aug 26, 2019

We should document some possibillities.

I'll try to create a rootless-dind sample. It will be a side container to renovate.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 26, 2019

Wouldn't the ideal solution be that you run Renovate (let's call it renovate/renovate:dind for now) and it can spawn "child" containers for renovate/go, renovate/pipenv, etc? i.e. no more side containers?

@viceice
Copy link
Member

viceice commented Aug 27, 2019

Yes, so we extend docker:stable-dind-rootless and add our specific stuff.

Bu we have to remember that dind-rootless currently needs --privileged mode.

@viceice
Copy link
Member

viceice commented Aug 27, 2019

But the daemon inside dind-rootless is running as user rootless. So this might be a feasible solution.

https://github.com/docker-library/docker/blob/c01ffa41486f70c34f020c769bc5bddf106367ea/19.03/dind-rootless/Dockerfile#L73

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

Yes, I thought the idea was that the process inside the dind container gets all the privileges of the user running it on the host, but can't break out to root. So don't leave any privileged info within the user account on the host.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

It would be pretty awesome to have a slim Docker image of Renovate that can span go/composer/pipenv/etc within child containers.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

Seems to be based off alpine though, but shouldn't be too hard. I hope we can keep the child containers all as ubuntu-based.

@viceice
Copy link
Member

viceice commented Aug 27, 2019

we can use the https://get.docker.com/rootless script to install local rootless docker.

I'll try that, we can start the daemon from renovate because renovate is the entrypoint.

We can check for RENOVATE_BINARY_SOURCE=docker to start the daemon

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

Do you mean you run the renovate slim image as a "regular" Docker image but then install run rootless Docker inside renovate slim?

@viceice
Copy link
Member

viceice commented Aug 27, 2019

maybe? or just start the dind side container manually?

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

It's really nice to make them child containers rather than siblings so you don't have to worry about host and all containers having the same directory structure.

@viceice
Copy link
Member

viceice commented Aug 27, 2019

then we need to run the docker daemon from renovate prior to start any containers

@viceice
Copy link
Member

viceice commented Aug 27, 2019

start as child is more difficult. i'll se if i get that managed

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

Let's assume that we discontinue the embedding of npm/yarn/pnpm as renovate dependencies and as a result there's a 90%+ likelihood that Renovate users will need child containers after that.

In that scenario:

  • the slim container should be built with rootless docker preinstalled, because it would be needed in 90%+ of users anyway
  • the entrypoint of this renovate slim image needs to start docker at the start of each run
  • renovate will spawn child containers, and be oblivious that it is running inside a "normal" Docker container itself
  • once Renovate is done, it might need to tear down rootless docker to exit cleanly?

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 27, 2019

Is another possible option that we say you need to run renovate with --privileged and recommend that people do that with rootless docker instead of regular docker? i.e. that way the Renovate container doesn't need to be running a Docker daemon of its own.

@viceice
Copy link
Member

viceice commented Aug 27, 2019

thats a possibillity.

Currently experimenting with podman as a drop-in replacement for docker. Here we don't need a daemon.

@viceice
Copy link
Member

viceice commented Aug 27, 2019

Simply run renovate in renovate 🙈

image

@viceice
Copy link
Member

viceice commented Sep 11, 2019

Problem

Docker in Docker or Podman in Docker is pretty slow. Mostly this is an IO bottleneck.

Idea

  • Add a volume for the Podman / Docker data to retain images and container.
  • pull image and start tool container ( with cat command) on first run (when required)
  • pull image on next run, if updated recreate tool container and prune obsolete images in background
  • use docker exec for running tool

I hope this idea is understandable 😅

@micheelengronne
Copy link

I would also add the kubernetes usecase. Renovate integrated in a kube environment should delegate the container management to kube itself (in particular if kube has another runtime than docker like CRI-O).

@rarkins
Copy link
Collaborator Author

rarkins commented May 4, 2020

@micheelengronne it would be helpful if you can create an issue describing those requirements in detail.

@micheelengronne
Copy link

@rarkins
Copy link
Collaborator Author

rarkins commented May 30, 2020

Superseded by #6364

@rarkins rarkins closed this as completed May 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants