Skip to content

non-root docker-container failed to start .e.g Jenkins #339

Description

@kknd22

Unsuccessfully try to use official Jenkins container for kitchen-test.
Digged a bit more and discovered that user is set to a non root 'jenkins'
https://github.com/jenkinsci/docker/blob/587b2856cd225bb152c4abeeaaa24934c75aa460/Dockerfile#L66
https://github.com/jenkinsci/docker/blob/587b2856cd225bb152c4abeeaaa24934c75aa460/Dockerfile#L5

The error is:

Step 3/16 : RUN yum clean all
 ---> Using cache
 ---> ef4ad2349c4
Step 4/16 : RUN yum install -y sudo openssh-server openssh-clients which curl
 ---> Running in bd2wr4a8139
Loaded plugins: fastestmirror, ovl
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/.dbenv.lock'
You need to be root to perform this command.

Tried adding in .kitchen.yml :

platforms:
  - name: centos-7   
    driver_config:
      image: jenkins
      run_options: --user=root:root

Without any luck.

Any help would be appreciated.
-ChrisL

BTW, this is not a Jenkins specific issue but for any container run not as root. Kitchen-Docker seems to have no way around this

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions