-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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-express for v1.0.0 #13162
Conversation
Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for
|
Can you try to replace syntax FYI @MahdiAbbasi95 |
I changed the variable syntax and I opened a new pull request in our repo. |
I've tested that the previous syntax works both on my machine and in a GitHub workflow, removing the {} doesn't seem safe. Some interpreters might have difficulty deciding what chars are part of the variable name and what aren't. Maybe we could change add to run wget instead? I think that might be more well supported |
I'll change it |
@BlackthornYugen |
Thanks! I've updated to use the latest version here. |
This comment has been minimized.
This comment has been minimized.
NPM install might be a nicer way to do it in the future but I don't think it needs to hold up this release. FYI: @knickers |
I wasn't aware of the test script at https://github.com/mongo-express/docker-official-images/blame/master/test/tests/mongo-express-run/run.sh -- I guess we should make sure that passes. We must have broken it somehow? Or something that used to work no longer works... |
It looks like it just tries to curl the root to get a 200OK, but it looks like basic auth is enabled so it is probably getting a 401? |
We could fix it by updating the test to use So we should probably should make sure that the default deployment of this container does not require basic auth for such users. tldr: basic auth will cause headaches for users and not increase security |
The test is only a basic smoke test; I'll leave it up to the The "Naughty" test is mentioning that the |
This comment has been minimized.
This comment has been minimized.
7de800a
to
f3bed1a
Compare
This comment has been minimized.
This comment has been minimized.
Should be good now I think |
Hello guys, thank you for your work 💪 |
I don't know, I think only @knickers or a docker-library admin have permission to merge. |
Apologies for the delay. 🙇♂️ Blocking:
Non-blocking:
|
Also blocking:
|
This PR should not include 0.54.0, moving forward we cannot support that version of alpine. I think we have also dropped support for node 12 but I'll need to double check.
That's a good point. We will update to pin a checksum.
The 1.0.0 version is always goign to fail this test but I think future versions should pass. Maybe we don't need 1.0.0? But it might be nice to give people the option to use it in case something was broken in a future version...
I thought I already did this but maybe I mistakenly reverted or something. Will double check. |
Both good points but should they be blockers? I don't have a ton of time and I'm really hoping we can get a version on dockerhub that isn't full of CVEs... things like this could be fixed in future versions right? |
The current PR's 1.0.1 can't build because If we can commit to updating these other things in the next PR, then I think it's reasonable for that to be the only real hard blocker here. |
@BlackthornYugen Is there any further update on this PR? |
I believe this will be unblocked after mongo-express/mongo-express-docker#93 is through. Should be able to update publish 1.0.0 and 1.0.1 this week. 🤞 |
This comment has been minimized.
This comment has been minimized.
Recreated using ./generate-stackbrew-library.sh from mongo-express/mongo-express-docker#93
@LaurentGoderre any idea why it doens't like it? I'm trying to use the output from + docker run --rm --read-only --tmpfs /tmp oisupport/bashbrew:diff-pr ./diff-pr.sh 13162
+ tee /home/runner/work/official-images/official-images/oi-pr.diff
failed fetching repo "mongo-express"
Bad line: '1.0.0-20 1.0-20 1-20 1.0.0-20-alpine3.17 1.0-20-alpine3.17 1-20-alpine3.17
' has no ':'
failed fetching repo "mongo-express"
Bad line: '1.0.0-20 1.0-20 1-20 1.0.0-20-alpine3.17 1.0-20-alpine3.17 1-20-alpine3.17
' has no ':'
Error: Process completed with exit code 1. |
library/mongo-express
Outdated
1.0.0-20 1.0-20 1-20 1.0.0-20-alpine3.17 1.0-20-alpine3.17 1-20-alpine3.17 | ||
Tags: 1.0.0-20, 1.0-20, 1-20, 1.0.0-20-alpine3.17, 1.0-20-alpine3.17, 1-20-alpine3.17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there is an extra line above the tags that it is getting hung up on. Maybe a debug line accidentally left in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right; didn't even notice that before. Let me take it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in dbc659b -- I also spaced out the variants so it's easier to read.
Remove debug line
Removed extra alpine commit
@LaurentGoderre it looks like it's not reading the path to the dockerfile correctly? Do we need to escape the forward slash? - mongo-express_1-20-alpine3.18/Dockerfile
+ mongo-express/1-20-alpine3.18/Dockerfile
|
The directories in the diff-pr script are not the same paths as the upstream repo but are just paths related to the image and tags it represents to help us compare across revisions. |
But doesn't the error makes it look like it can't find the Dockerfile? |
Yes, because the first entry is missing its |
Ah! Thanks for the hints 😅 Going to try again with the changes suggested. PR here: |
Fixed directory ( I think )
Fix my fix (don't quote on line 86)
Diff for de73829:diff --git a/_bashbrew-cat b/_bashbrew-cat
index 3efea56..eaae1f5 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,10 +1,23 @@
-Maintainers: Nick Cox <nickcox1008@gmail.com> (@knickers)
+Maintainers: Nick Cox <nickcox1008@gmail.com> (@knickers), John Steel <john@jskw.dev> (@BlackthornYugen)
GitRepo: https://github.com/mongo-express/mongo-express-docker.git
+GitCommit: 0b9b935b188caa945834a27f7475a059c4e60b13
-Tags: 0.54.0, 0.54
+Tags: 1.0.0, 1.0, 1, 1.0.0-18, 1.0-18, 1-18, 1.0.0-18-alpine3.17, 1.0-18-alpine3.17, 1-18-alpine3.17, latest
Architectures: amd64, arm64v8
-GitCommit: 4b43fe8a1206434cb32a006cd155dd71462f092f
+GitCommit: 5fb537b2fd181e458f58137fdb55d061a8c23da5
+Directory: 1.0/18-alpine3.17
-Tags: 1.0.0-alpha.4, 1.0.0-alpha, latest
+Tags: 1.0.0-18-alpine3.18, 1.0-18-alpine3.18, 1-18-alpine3.18
Architectures: amd64, arm64v8
-GitCommit: 26e7ea94e4d222de7d52531caee52149ac093c26
+GitCommit: 5fb537b2fd181e458f58137fdb55d061a8c23da5
+Directory: 1.0/18-alpine3.18
+
+Tags: 1.0.0-20, 1.0-20, 1-20, 1.0.0-20-alpine3.17, 1.0-20-alpine3.17, 1-20-alpine3.17
+Architectures: amd64, arm64v8
+GitCommit: 5fb537b2fd181e458f58137fdb55d061a8c23da5
+Directory: 1.0/20-alpine3.17
+
+Tags: 1.0.0-20-alpine3.18, 1.0-20-alpine3.18, 1-20-alpine3.18
+Architectures: amd64, arm64v8
+GitCommit: 5fb537b2fd181e458f58137fdb55d061a8c23da5
+Directory: 1.0/20-alpine3.18
diff --git a/_bashbrew-list b/_bashbrew-list
index 6539baf..fc9ea53 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,5 +1,22 @@
-mongo-express:0.54
-mongo-express:0.54.0
-mongo-express:1.0.0-alpha
-mongo-express:1.0.0-alpha.4
+mongo-express:1
+mongo-express:1-18
+mongo-express:1-18-alpine3.17
+mongo-express:1-18-alpine3.18
+mongo-express:1-20
+mongo-express:1-20-alpine3.17
+mongo-express:1-20-alpine3.18
+mongo-express:1.0
+mongo-express:1.0-18
+mongo-express:1.0-18-alpine3.17
+mongo-express:1.0-18-alpine3.18
+mongo-express:1.0-20
+mongo-express:1.0-20-alpine3.17
+mongo-express:1.0-20-alpine3.18
+mongo-express:1.0.0
+mongo-express:1.0.0-18
+mongo-express:1.0.0-18-alpine3.17
+mongo-express:1.0.0-18-alpine3.18
+mongo-express:1.0.0-20
+mongo-express:1.0.0-20-alpine3.17
+mongo-express:1.0.0-20-alpine3.18
mongo-express:latest
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index 4fe3397..72a7e31 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,2 +1,4 @@
-mongo-express:0.54
mongo-express:latest
+mongo-express:1-18-alpine3.18
+mongo-express:1-20-alpine3.17
+mongo-express:1-20-alpine3.18
diff --git a/mongo-express_0.54/Dockerfile b/mongo-express_1-18-alpine3.18/Dockerfile
similarity index 43%
copy from mongo-express_0.54/Dockerfile
copy to mongo-express_1-18-alpine3.18/Dockerfile
index af47fda..744abee 100644
--- a/mongo-express_0.54/Dockerfile
+++ b/mongo-express_1-18-alpine3.18/Dockerfile
@@ -1,31 +1,30 @@
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
+
# https://nodejs.org/en/about/releases/
# https://github.com/nodejs/Release#readme
-FROM node:12-alpine3.11
-
-RUN apk add --no-cache bash tini
-
-EXPOSE 8081
+FROM node:18-alpine3.18
# override some config defaults with values that will work better for docker
-ENV ME_CONFIG_EDITORTHEME="default" \
- ME_CONFIG_MONGODB_SERVER="mongo" \
+ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \
- ME_CONFIG_BASICAUTH_USERNAME="" \
- ME_CONFIG_BASICAUTH_PASSWORD="" \
VCAP_APP_HOST="0.0.0.0"
-ENV MONGO_EXPRESS 0.54.0
+ENV MONGO_EXPRESS_VERSION=1.0.0
RUN set -eux; \
- apk add --no-cache --virtual .me-install-deps git; \
- npm install mongo-express@$MONGO_EXPRESS; \
- apk del --no-network .me-install-deps
-
-COPY docker-entrypoint.sh /
+ yarn add mongo-express@${MONGO_EXPRESS_VERSION}; \
+ apk -U add --no-cache \
+ bash \
+ # grab tini for signal processing and zombie killing
+ tini
WORKDIR /node_modules/mongo-express
-RUN cp config.default.js config.js
-
-ENTRYPOINT [ "tini", "--", "/docker-entrypoint.sh"]
+EXPOSE 8081
+COPY docker-entrypoint.sh /
+ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["mongo-express"]
diff --git a/mongo-express_0.54/docker-entrypoint.sh b/mongo-express_1-18-alpine3.18/docker-entrypoint.sh
similarity index 61%
rename from mongo-express_0.54/docker-entrypoint.sh
rename to mongo-express_1-18-alpine3.18/docker-entrypoint.sh
index 12d38f4..185b3b9 100755
--- a/mongo-express_0.54/docker-entrypoint.sh
+++ b/mongo-express_1-18-alpine3.18/docker-entrypoint.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# This file is auto-generated. Do not edit directly!
set -eo pipefail
# if command does not start with mongo-express, run the command instead of the entrypoint
@@ -19,12 +20,16 @@ function wait_tcp_port {
exec 6>&-
}
+
+# TODO: Using ME_CONFIG_MONGODB_SERVER is going to be deprecated, a way to parse connection string
+# is required for checking port health
+
# if ME_CONFIG_MONGODB_SERVER has a comma in it, we're pointing to a replica set (https://github.com/mongo-express/mongo-express-docker/issues/21)
-if [[ "$ME_CONFIG_MONGODB_SERVER" != *,* ]]; then
- # wait for the mongo server to be available
- echo Waiting for ${ME_CONFIG_MONGODB_SERVER}:${ME_CONFIG_MONGODB_PORT:-27017}...
- wait_tcp_port "${ME_CONFIG_MONGODB_SERVER}" "${ME_CONFIG_MONGODB_PORT:-27017}"
-fi
+# if [[ "$ME_CONFIG_MONGODB_SERVER" != *,* ]]; then
+# # wait for the mongo server to be available
+# echo Waiting for ${ME_CONFIG_MONGODB_SERVER}:${ME_CONFIG_MONGODB_PORT:-27017}...
+# wait_tcp_port "${ME_CONFIG_MONGODB_SERVER}" "${ME_CONFIG_MONGODB_PORT:-27017}"
+# fi
# run mongo-express
exec node app
diff --git a/mongo-express_0.54/Dockerfile b/mongo-express_1-20-alpine3.17/Dockerfile
similarity index 43%
copy from mongo-express_0.54/Dockerfile
copy to mongo-express_1-20-alpine3.17/Dockerfile
index af47fda..92e363c 100644
--- a/mongo-express_0.54/Dockerfile
+++ b/mongo-express_1-20-alpine3.17/Dockerfile
@@ -1,31 +1,30 @@
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
+
# https://nodejs.org/en/about/releases/
# https://github.com/nodejs/Release#readme
-FROM node:12-alpine3.11
-
-RUN apk add --no-cache bash tini
-
-EXPOSE 8081
+FROM node:20-alpine3.17
# override some config defaults with values that will work better for docker
-ENV ME_CONFIG_EDITORTHEME="default" \
- ME_CONFIG_MONGODB_SERVER="mongo" \
+ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \
- ME_CONFIG_BASICAUTH_USERNAME="" \
- ME_CONFIG_BASICAUTH_PASSWORD="" \
VCAP_APP_HOST="0.0.0.0"
-ENV MONGO_EXPRESS 0.54.0
+ENV MONGO_EXPRESS_VERSION=1.0.0
RUN set -eux; \
- apk add --no-cache --virtual .me-install-deps git; \
- npm install mongo-express@$MONGO_EXPRESS; \
- apk del --no-network .me-install-deps
-
-COPY docker-entrypoint.sh /
+ yarn add mongo-express@${MONGO_EXPRESS_VERSION}; \
+ apk -U add --no-cache \
+ bash \
+ # grab tini for signal processing and zombie killing
+ tini
WORKDIR /node_modules/mongo-express
-RUN cp config.default.js config.js
-
-ENTRYPOINT [ "tini", "--", "/docker-entrypoint.sh"]
+EXPOSE 8081
+COPY docker-entrypoint.sh /
+ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["mongo-express"]
diff --git a/mongo-express_latest/docker-entrypoint.sh b/mongo-express_1-20-alpine3.17/docker-entrypoint.sh
similarity index 95%
copy from mongo-express_latest/docker-entrypoint.sh
copy to mongo-express_1-20-alpine3.17/docker-entrypoint.sh
index d201689..185b3b9 100755
--- a/mongo-express_latest/docker-entrypoint.sh
+++ b/mongo-express_1-20-alpine3.17/docker-entrypoint.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# This file is auto-generated. Do not edit directly!
set -eo pipefail
# if command does not start with mongo-express, run the command instead of the entrypoint
diff --git a/mongo-express_0.54/Dockerfile b/mongo-express_1-20-alpine3.18/Dockerfile
similarity index 43%
rename from mongo-express_0.54/Dockerfile
rename to mongo-express_1-20-alpine3.18/Dockerfile
index af47fda..ed08825 100644
--- a/mongo-express_0.54/Dockerfile
+++ b/mongo-express_1-20-alpine3.18/Dockerfile
@@ -1,31 +1,30 @@
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
+
# https://nodejs.org/en/about/releases/
# https://github.com/nodejs/Release#readme
-FROM node:12-alpine3.11
-
-RUN apk add --no-cache bash tini
-
-EXPOSE 8081
+FROM node:20-alpine3.18
# override some config defaults with values that will work better for docker
-ENV ME_CONFIG_EDITORTHEME="default" \
- ME_CONFIG_MONGODB_SERVER="mongo" \
+ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \
- ME_CONFIG_BASICAUTH_USERNAME="" \
- ME_CONFIG_BASICAUTH_PASSWORD="" \
VCAP_APP_HOST="0.0.0.0"
-ENV MONGO_EXPRESS 0.54.0
+ENV MONGO_EXPRESS_VERSION=1.0.0
RUN set -eux; \
- apk add --no-cache --virtual .me-install-deps git; \
- npm install mongo-express@$MONGO_EXPRESS; \
- apk del --no-network .me-install-deps
-
-COPY docker-entrypoint.sh /
+ yarn add mongo-express@${MONGO_EXPRESS_VERSION}; \
+ apk -U add --no-cache \
+ bash \
+ # grab tini for signal processing and zombie killing
+ tini
WORKDIR /node_modules/mongo-express
-RUN cp config.default.js config.js
-
-ENTRYPOINT [ "tini", "--", "/docker-entrypoint.sh"]
+EXPOSE 8081
+COPY docker-entrypoint.sh /
+ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["mongo-express"]
diff --git a/mongo-express_latest/docker-entrypoint.sh b/mongo-express_1-20-alpine3.18/docker-entrypoint.sh
similarity index 95%
copy from mongo-express_latest/docker-entrypoint.sh
copy to mongo-express_1-20-alpine3.18/docker-entrypoint.sh
index d201689..185b3b9 100755
--- a/mongo-express_latest/docker-entrypoint.sh
+++ b/mongo-express_1-20-alpine3.18/docker-entrypoint.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# This file is auto-generated. Do not edit directly!
set -eo pipefail
# if command does not start with mongo-express, run the command instead of the entrypoint
diff --git a/mongo-express_latest/Dockerfile b/mongo-express_latest/Dockerfile
index 06f59f5..9e05d4c 100644
--- a/mongo-express_latest/Dockerfile
+++ b/mongo-express_latest/Dockerfile
@@ -1,31 +1,30 @@
+#
+# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
+#
+# PLEASE DO NOT EDIT IT DIRECTLY.
+#
+
# https://nodejs.org/en/about/releases/
# https://github.com/nodejs/Release#readme
-FROM node:12-alpine3.11
-
-RUN apk add --no-cache bash tini
-
-EXPOSE 8081
+FROM node:18-alpine3.17
# override some config defaults with values that will work better for docker
-ENV ME_CONFIG_EDITORTHEME="default" \
- ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
+ENV ME_CONFIG_MONGODB_URL="mongodb://mongo:27017" \
ME_CONFIG_MONGODB_ENABLE_ADMIN="true" \
- ME_CONFIG_BASICAUTH_USERNAME="" \
- ME_CONFIG_BASICAUTH_PASSWORD="" \
VCAP_APP_HOST="0.0.0.0"
-ENV MONGO_EXPRESS 1.0.0-alpha.4
+ENV MONGO_EXPRESS_VERSION=1.0.0
RUN set -eux; \
- apk add --no-cache --virtual .me-install-deps git; \
- npm install mongo-express@$MONGO_EXPRESS; \
- apk del --no-network .me-install-deps
-
-COPY docker-entrypoint.sh /
+ yarn add mongo-express@${MONGO_EXPRESS_VERSION}; \
+ apk -U add --no-cache \
+ bash \
+ # grab tini for signal processing and zombie killing
+ tini
WORKDIR /node_modules/mongo-express
-RUN cp config.default.js config.js
-
-ENTRYPOINT [ "tini", "--", "/docker-entrypoint.sh"]
+EXPOSE 8081
+COPY docker-entrypoint.sh /
+ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh"]
CMD ["mongo-express"]
diff --git a/mongo-express_latest/docker-entrypoint.sh b/mongo-express_latest/docker-entrypoint.sh
index d201689..185b3b9 100755
--- a/mongo-express_latest/docker-entrypoint.sh
+++ b/mongo-express_latest/docker-entrypoint.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# This file is auto-generated. Do not edit directly!
set -eo pipefail
# if command does not start with mongo-express, run the command instead of the entrypoint Relevant Maintainers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No worries on the mongo-express-run
test. It needs changes to support mongo-express 1.x
, so we can just ignore them for now. I'm up for just dropping the test, but we can also see if there is a way to update it to work.
Edit: link to mongo-express-run
test
Mostly security updates and new configuration to support breaking changes in mongo-db driver.
See related pull requests:
mongo-express/mongo-express#920
mongo-express/mongo-express-docker#82
Full release notes available here:
v1.0.0 - Initial node18 support
v1.0.1 - Convert to ESMEdit 2023/10/02: Removed v1.0.1 from the scope of this MR. Once we get 1.0.0 working we will immediately open a new MR for 1.0.1.