-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Update mongo #12484
Merged
Merged
Update mongo #12484
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes: - docker-library/mongo@f610f40: Merge pull request docker-library/mongo#541 from infosiftr/mongoshhhh - docker-library/mongo@090e563: Add home to mongodb user so that "mongosh" works again
Diff for 41be537:diff --git a/_bashbrew-cat b/_bashbrew-cat
index c0d5d9a..582d2a2 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -32,13 +32,13 @@ Constraints: windowsservercore-ltsc2022
Tags: 4.0.28-xenial, 4.0-xenial
SharedTags: 4.0.28, 4.0
Architectures: amd64, arm64v8
-GitCommit: 6f8fe0cc9b34501014d98834e386889facf6e392
+GitCommit: 090e5631c17be189046b6dea907f0e5e75d01162
Directory: 4.0
Tags: 4.2.20-bionic, 4.2-bionic
SharedTags: 4.2.20, 4.2
Architectures: amd64, arm64v8
-GitCommit: 918850beff117aec4aa2cb8db464211d72930809
+GitCommit: 090e5631c17be189046b6dea907f0e5e75d01162
Directory: 4.2
Tags: 4.2.20-nanoserver-1809, 4.2-nanoserver-1809
@@ -72,7 +72,7 @@ Constraints: windowsservercore-ltsc2022
Tags: 4.4.14-focal, 4.4-focal, 4-focal
SharedTags: 4.4.14, 4.4, 4
Architectures: amd64, arm64v8
-GitCommit: d7fcf97417a9cb67f4677a85db7050980ed63580
+GitCommit: 090e5631c17be189046b6dea907f0e5e75d01162
Directory: 4.4
Tags: 4.4.14-nanoserver-1809, 4.4-nanoserver-1809, 4-nanoserver-1809
@@ -106,7 +106,7 @@ Constraints: windowsservercore-ltsc2022
Tags: 5.0.8-focal, 5.0-focal, 5-focal, focal
SharedTags: 5.0.8, 5.0, 5, latest
Architectures: amd64, arm64v8
-GitCommit: 5faa46234f12b4af395ffa554c3ab28fc6d02ed3
+GitCommit: 090e5631c17be189046b6dea907f0e5e75d01162
Directory: 5.0
Tags: 5.0.8-nanoserver-1809, 5.0-nanoserver-1809, 5-nanoserver-1809, nanoserver-1809
diff --git a/mongo_4-focal/Dockerfile b/mongo_4-focal/Dockerfile
index 2c84e42..873f2cf 100644
--- a/mongo_4-focal/Dockerfile
+++ b/mongo_4-focal/Dockerfile
@@ -7,7 +7,11 @@
FROM ubuntu:focal
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
-RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
+RUN set -eux; \
+ groupadd --gid 999 --system mongodb; \
+ useradd --uid 999 --system --gid mongodb --home-dir /data/db mongodb; \
+ mkdir -p /data/db /data/configdb; \
+ chown -R mongodb:mongodb /data/db /data/configdb
RUN set -eux; \
apt-get update; \
@@ -108,10 +112,12 @@ RUN set -x \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
-RUN mkdir -p /data/db /data/configdb \
- && chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb
+# ensure that if running as custom user that "mongosh" has a valid "HOME"
+# https://github.com/docker-library/mongo/issues/524
+ENV HOME /data/db
+
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
diff --git a/mongo_4.0-xenial/Dockerfile b/mongo_4.0-xenial/Dockerfile
index 9b36947..037c0e1 100644
--- a/mongo_4.0-xenial/Dockerfile
+++ b/mongo_4.0-xenial/Dockerfile
@@ -7,7 +7,11 @@
FROM ubuntu:xenial
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
-RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
+RUN set -eux; \
+ groupadd --gid 999 --system mongodb; \
+ useradd --uid 999 --system --gid mongodb --home-dir /data/db mongodb; \
+ mkdir -p /data/db /data/configdb; \
+ chown -R mongodb:mongodb /data/db /data/configdb
RUN set -eux; \
apt-get update; \
@@ -108,10 +112,12 @@ RUN set -x \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
-RUN mkdir -p /data/db /data/configdb \
- && chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb
+# ensure that if running as custom user that "mongosh" has a valid "HOME"
+# https://github.com/docker-library/mongo/issues/524
+ENV HOME /data/db
+
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
diff --git a/mongo_4.2-bionic/Dockerfile b/mongo_4.2-bionic/Dockerfile
index 464fe81..1216674 100644
--- a/mongo_4.2-bionic/Dockerfile
+++ b/mongo_4.2-bionic/Dockerfile
@@ -7,7 +7,11 @@
FROM ubuntu:bionic
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
-RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
+RUN set -eux; \
+ groupadd --gid 999 --system mongodb; \
+ useradd --uid 999 --system --gid mongodb --home-dir /data/db mongodb; \
+ mkdir -p /data/db /data/configdb; \
+ chown -R mongodb:mongodb /data/db /data/configdb
RUN set -eux; \
apt-get update; \
@@ -108,10 +112,12 @@ RUN set -x \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
-RUN mkdir -p /data/db /data/configdb \
- && chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb
+# ensure that if running as custom user that "mongosh" has a valid "HOME"
+# https://github.com/docker-library/mongo/issues/524
+ENV HOME /data/db
+
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
diff --git a/mongo_focal/Dockerfile b/mongo_focal/Dockerfile
index 4b3e726..ffb7df4 100644
--- a/mongo_focal/Dockerfile
+++ b/mongo_focal/Dockerfile
@@ -7,7 +7,11 @@
FROM ubuntu:focal
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
-RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
+RUN set -eux; \
+ groupadd --gid 999 --system mongodb; \
+ useradd --uid 999 --system --gid mongodb --home-dir /data/db mongodb; \
+ mkdir -p /data/db /data/configdb; \
+ chown -R mongodb:mongodb /data/db /data/configdb
RUN set -eux; \
apt-get update; \
@@ -108,10 +112,12 @@ RUN set -x \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
-RUN mkdir -p /data/db /data/configdb \
- && chown -R mongodb:mongodb /data/db /data/configdb
VOLUME /data/db /data/configdb
+# ensure that if running as custom user that "mongosh" has a valid "HOME"
+# https://github.com/docker-library/mongo/issues/524
+ENV HOME /data/db
+
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"] Relevant Maintainers: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes: