chore: use docker user

This commit is contained in:
Michael Kriese 2020-05-07 10:28:29 +02:00
parent de14f4f817
commit bac795faac
2 changed files with 3 additions and 5 deletions

View file

@ -20,15 +20,16 @@ class Renovate {
}
async runDockerContainer(): Promise<void> {
await exec('whoami');
await exec('sudo', ['usermod', '-aG', 'docker', 'runneradmin']);
const commandArguments = [
'--rm',
`--env ${this.configFileEnv}=${this.configFileMountPath()}`,
`--env ${this.tokenEnv}=${this.token}`,
`-e RENOVATE_DOCKER_USER=1001`,
`-e HOME=/home/ubuntu`,
`--volume ${this.configFile}:${this.configFileMountPath()}`,
`-v /var/run/docker.sock:/var/run/docker.sock`,
`-v /tmp:/tmp`,
`-u 1001`,
this.docker.image(),
];
const command = `docker run ${commandArguments.join(' ')}`;