Skip to content

MongoDB 4.2 is not suitable for use as a service in Gitlab CI #390

@romintomasetti

Description

@romintomasetti

What's going on here?

Using the published Docker image of MongoDB (latest as of now, so 4.2.2 but I think the problem is the same with previous versions) as a service in Gitlab CI fails because the directory /home/mongodb/ is missing.

Error saving history file: FileOpenFailed: Unable to open() file /home/mongodb/.dbshell: No such file or directory

Proposed fix

See line

RUN groupadd -r mongodb && useradd -r -g mongodb mongodb

Instead, it should be:

RUN groupadd -r mongodb && useradd -r -m -g mongodb mongodb

so that the home directory is created. Tested, it seemed to fix the issue.

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