Skip to content
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

Merged
merged 10 commits into from
Oct 2, 2023
Merged

Conversation

BlackthornYugen
Copy link
Contributor

@BlackthornYugen BlackthornYugen commented Sep 16, 2022

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 ESM

Edit 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.

@BlackthornYugen
Copy link
Contributor Author

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

@BlackthornYugen
Copy link
Contributor Author

BlackthornYugen commented Sep 16, 2022

Maybe it's just that docker official images don't support adding from a URL? Should we replace it with a RUN wget? Or maybe we should rollback to using npm install now that v1.0.0 is published to NPM...

FYI @shakaran @rtritto @knickers

@rtritto
Copy link

rtritto commented Sep 16, 2022

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

Can you try to replace syntax ${var} to $var?

FYI @MahdiAbbasi95

@MahdiAbbasi95
Copy link

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

Can you try to replace syntax ${var} to $var?

FYI @MahdiAbbasi95

I changed the variable syntax and I opened a new pull request in our repo.
Please check it and merge.

mongo-express/mongo-express-docker#84

@BlackthornYugen @shakaran

@BlackthornYugen
Copy link
Contributor Author

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

Can you try to replace syntax ${var} to $var?

FYI @MahdiAbbasi95

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

@MahdiAbbasi95
Copy link

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

Can you try to replace syntax ${var} to $var?
FYI @MahdiAbbasi95

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

@MahdiAbbasi95
Copy link

Looks like we have a bug in our dockerfile, maybe an overloaded environment variable / build arg. It's trying to look for github.com/mongo-express_latest/.

cp: cannot stat 'tar/mongo-express_latest/[https://github.com/${MONGO_REPOSITORY}/archive/refs/tags/${MONGO_EXPRESS_TAG}.tar.gz](https://github.com/$%7BMONGO_REPOSITORY%7D/archive/refs/tags/$%7BMONGO_EXPRESS_TAG%7D.tar.gz)': No such file or directory

Can you try to replace syntax ${var} to $var?
FYI @MahdiAbbasi95

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
I've changed and tested it, please check the PR.

@BlackthornYugen
Copy link
Contributor Author

@BlackthornYugen I've changed and tested it, please check the PR.

Thanks! I've updated to use the latest version here.

@github-actions

This comment has been minimized.

@rtritto
Copy link

rtritto commented Sep 16, 2022

@BlackthornYugen
Copy link
Contributor Author

@BlackthornYugen mongo-express/mongo-express-docker#82 (comment)

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

@BlackthornYugen
Copy link
Contributor Author

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...

@BlackthornYugen
Copy link
Contributor Author

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?

@BlackthornYugen
Copy link
Contributor Author

We could fix it by updating the test to use curl --user "admin:pass" --fail --silent --location --request "$method" "$@" "http://me:8081/$url" ; however, having a default credential isn't really more secure than having no basic auth requirement. We are probably going to break deployments that are already secured through a reverse proxy (like I do).

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

@yosifkit
Copy link
Member

The test is only a basic smoke test; I'll leave it up to the mongo-express image maintainers whether to change the test and/or the image. I am glad that it is helping find a possible UX issue with the new release.

The "Naughty" test is mentioning that the mongo-express:0.54.0 image is FROM node:12-alpine3.11, which is an image that is no longer supported or updated. That means that it misses out on the automatic image rebuilds of the official images that are triggered by a parent image update. So the 0.54.0 image should either be dropped or updated to a supported release of the node image. Removing it here will remove it from the "Supported" section on the Hub readme, but the tag will still be available to users who want it. (See https://github.com/docker-library/official-images#library-definition-files for more detail on this.)

@BlackthornYugen BlackthornYugen changed the title Update mongo-express to use v1.0.0 release Update mongo-express for v1.0.0 and v1.0.1 releases Feb 19, 2023
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@BlackthornYugen
Copy link
Contributor Author

The test is only a basic smoke test; I'll leave it up to the mongo-express image maintainers whether to change the test and/or the image. I am glad that it is helping find a possible UX issue with the new release.

The "Naughty" test is mentioning that the mongo-express:0.54.0 image is FROM node:12-alpine3.11, which is an image that is no longer supported or updated. That means that it misses out on the automatic image rebuilds of the official images that are triggered by a parent image update. So the 0.54.0 image should either be dropped or updated to a supported release of the node image. Removing it here will remove it from the "Supported" section on the Hub readme, but the tag will still be available to users who want it. (See https://github.com/docker-library/official-images#library-definition-files for more detail on this.)

Should be good now I think

@jeremyjams
Copy link

Hello guys, thank you for your work 💪
Do you have any updates on this?

@BlackthornYugen
Copy link
Contributor Author

Hello guys, thank you for your work 💪 Do you have any updates on this?

I don't know, I think only @knickers or a docker-library admin have permission to merge.

@yosifkit
Copy link
Member

Apologies for the delay. 🙇‍♂️

Blocking:

  1. Neither of the two below images have an up-to-date base image. The image it is FROM needs to be an active Docker Official Image. node:12* is not a maintained version of the node image. It should be FROM 18 or 20 since Node.js 14 and 16 are end of life at the end of April and September, respectively. (unless you want to update again when those are removed). node:12-alpine3.16 is not a valid image, since node:12 never had an Alpine 3.16 image and Node.js 12 is end of life anyway.

    - mongo-express:0.54.0 (FROM node:12-alpine3.11) -- completely unsupported base!
    - mongo-express:1.0.1 (FROM node:12-alpine3.16) -- completely unsupported base!

  2. For the 1.0.0 Dockerfile: anything downloaded (even over https) should be verified in some way, usually via a detached gpg signature or, if that's unavailable, via a checksum embedded in the Dockerfile (https://github.com/docker-library/official-images/tree/20ad9922430f293411aa6808c12a7e1ec73ff219#image-build).

Non-blocking:

  1. We have a basic integration test for mongo-express in test/tests/mongo-express-run/run.sh; it is failing on the 1.0.0 version. If it could be updated to support 1.x that'd be great, but if not, we are happy to drop that test if it isn't useful to you for us to run.

  2. If mongo-express 0.54 is no longer supported now that 1.x is out, it should be removed from the library/mongo-express file. The current image will remain available to pull from Docker Hub. (0.54 doesn't have to be removed, but it does need an updated base image if kept)

@tianon
Copy link
Member

tianon commented Apr 24, 2023

Also blocking:

  1. chmod +x on a file that's COPY'd previously will copy the file, so the executable bit should be applied in Git instead (and then COPY will apply it correctly)
  2. the COPY of the entrypoint should happen as low in the Dockerfile as possible (at the very least, after the installation of mongo-express)

@BlackthornYugen
Copy link
Contributor Author

  1. Neither of the two below images have an up-to-date base image. The image it is FROM needs to be an active Docker Official Image. node:12* is not a maintained version of the node image. It should be FROM 18 or 20 since Node.js 14 and 16 are end of life at the end of April and September, respectively. (unless you want to update again when those are removed). node:12-alpine3.16 is not a valid image, since node:12 never had an Alpine 3.16 image and Node.js 12 is end of life anyway.

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.

2. For the 1.0.0 Dockerfile: anything downloaded (even over https) should be verified in some way, usually via a detached gpg signature or, if that's unavailable, via a checksum embedded in the Dockerfile (https://github.com/docker-library/official-images/tree/20ad9922430f293411aa6808c12a7e1ec73ff219#image-build).

That's a good point. We will update to pin a checksum.

3. We have a basic integration test for mongo-express in test/tests/mongo-express-run/run.sh; it is failing on the 1.0.0 version. If it could be updated to support 1.x that'd be great, but if not, we are happy to drop that test if it isn't useful to you for us to run.

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...

4. If mongo-express 0.54 is no longer supported now that 1.x is out, it should be removed from the library/mongo-express file. The current image will remain available to pull from Docker Hub. (0.54 doesn't have to be removed, but it does need an updated base image if kept)

I thought I already did this but maybe I mistakenly reverted or something. Will double check.

@BlackthornYugen
Copy link
Contributor Author

Also blocking:

1. `chmod +x` on a file that's `COPY`'d previously will copy the file, so the executable bit should be applied in Git instead (and then `COPY` will apply it correctly)

2. the `COPY` of the entrypoint should happen as low in the `Dockerfile` as possible (at the very least, after the installation of `mongo-express`)

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?

@tianon
Copy link
Member

tianon commented May 11, 2023

The current PR's 1.0.1 can't build because node:12-alpine3.16 doesn't exist (and never did 😬).

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.

@armond-avanes
Copy link

@BlackthornYugen Is there any further update on this PR?

@BlackthornYugen
Copy link
Contributor Author

@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. 🤞

@github-actions

This comment has been minimized.

@BlackthornYugen
Copy link
Contributor Author

@LaurentGoderre any idea why it doens't like it? I'm trying to use the output from ./generate-stackbrew-library.sh. It says it wants a ':', but the previous one didn't have colons in tags, it was comma delimited.

+ 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.

Comment on lines 11 to 12
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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2023

I think dropping line 110 and adding a plain echo before the cat on line116 (or a newline to start the cat) should get generate-stackbrew-library.sh to the correct output. (Plus adding yourself to the Maintainers on 49)

Line 51 could also be dropped but is harmless.

@BlackthornYugen
Copy link
Contributor Author

@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
Run docker run --rm --read-only --tmpfs /tmp oisupport/bashbrew:diff-pr ./diff-pr.sh "$GITHUB_PR_NUMBER" | tee "$GITHUB_WORKSPACE/oi-pr.diff"
+ 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
gawk: cmd. line:2: fatal: cannot open file `tar/mongo-express_1-20-alpine3.18/Dockerfile' for reading: No such file or directory
Error: Process completed with exit code 2.

@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2023

it looks like it's not reading the path to the dockerfile correctly? Do we need to escape the forward slash?

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.

@BlackthornYugen BlackthornYugen changed the title Update mongo-express for v1.0.0 and v1.0.1 releases Update mongo-express for v1.0.0 Oct 2, 2023
@BlackthornYugen
Copy link
Contributor Author

it looks like it's not reading the path to the dockerfile correctly? Do we need to escape the forward slash?

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?

@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2023

But doesn't the error makes it look like it can't find the Dockerfile?

Yes, because the first entry is missing its Directory and GitCommit (which is on the second entry, and the second is on the third, etc).

@BlackthornYugen
Copy link
Contributor Author

But doesn't the error makes it look like it can't find the Dockerfile?

Yes, because the first entry is missing its Directory and GitCommit (which is on the second entry, and the second is on the third, etc).

Ah! Thanks for the hints 😅

Going to try again with the changes suggested. PR here:
mongo-express/mongo-express-docker#100

Fixed directory ( I think )
library/mongo-express Outdated Show resolved Hide resolved
Fix my fix (don't quote on line 86)
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

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:

Copy link
Member

@yosifkit yosifkit left a 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

@yosifkit yosifkit merged commit ea2c2b6 into docker-library:master Oct 2, 2023
5 of 9 checks passed
@BlackthornYugen
Copy link
Contributor Author

@armond1978 @rtritto @shakaran 1.0.0 is up but we have a bug to resolve in 1.0.1.

mongo-express/mongo-express-docker#97

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

Successfully merging this pull request may close these issues.

None yet

8 participants