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 docker build #107

Closed
wants to merge 2 commits into from
Closed

Conversation

fitztrev
Copy link
Contributor

@fitztrev fitztrev commented Jan 2, 2024

Took a very opinionated approach and just build one version, rather than the matrix-style that it was doing before.

Base image is node:20.10.0-alpine3.19

Updated the bottom of the README with the build + run commands.

Fixes #104

@fitztrev
Copy link
Contributor Author

fitztrev commented Jan 2, 2024

I'm not familiar with the internals of mongo-express but I use this image in a project and I'm pretty comfortable with Docker. Tried to make the build simpler until I got it working. If there's anything I excluded that I shouldn't have, please just let me know.

Dockerfile Outdated
ENV ME_CONFIG_SITE_SESSIONSECRET="secret"
ENV VCAP_APP_HOST="0.0.0.0"

RUN git clone https://github.com/mongo-express/mongo-express.git /app
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 this is just building from master, can we build from a given NPM version? Otherwise maybe we could build from the tagged version with -b <TAG> and take that tag as a docker build argument? I think we can make the default master so it's easy for people to build locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing with it hardcoded to v1.0.2 now.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. This is working for me if we use the tagged version of mongo-express. Would it be okay if I pushed a commit that uses your dockerfile changes in with the matrix pattern that was in place previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just pushed with an option to override the version:

docker build --build-arg MONGO_EXPRESS_VERSION=v1.0.2 --tag mongo-express .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be okay if I pushed a commit that uses your dockerfile changes in with the matrix pattern that was in place previously?

Sure! I'm not sure how it was working before so I may not be any help to you. But if you wanted to setup a github action that does the matrix builds that way and then publishes to Docker Hub, that could be another option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The official docker images are currently built from https://github.com/docker-library/official-images, they just need the git ref and the dockerfile for each version. It looks like this:

# this file is generated via https://github.com/mongo-express/mongo-express-docker/blob/0b9b935b188caa945834a27f7475a059c4e60b13/generate-stackbrew-library.sh

Maintainers: Nick Cox <[email protected]> (@knickers),
             John Steel <[email protected]> (@BlackthornYugen)
GitRepo: https://github.com/mongo-express/mongo-express-docker.git
GitCommit: 0b9b935b188caa945834a27f7475a059c4e60b13

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

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-18-alpine3.18, 1.0-18-alpine3.18, 1-18-alpine3.18
Architectures: amd64, arm64v8
GitCommit: 5fb537b2fd181e458f58137fdb55d061a8c23da5
Directory: 1.0/18-alpine3.18

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: 5fb537b2fd181e458f58137fdb55d061a8c23da5
Directory: 1.0/18-alpine3.17

See: https://github.com/docker-library/official-images/blob/master/library/mongo-express

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we had stuff in the README.md that explained how the templates work. But I don't see it. I'll make a separate commit that makes that a bit more clear. Sorry that it's a bit confusing at the moment.

I can push something in a couple hours that should work. Need to cook dinner 🙂

@BlackthornYugen
Copy link
Member

@fitztrev I don't seem to have permission to force push so I put my changes in #108 for now. I did a PR to the docker official images repo to see if it is able to build over there. See docker-library/official-images#15991

@fitztrev
Copy link
Contributor Author

fitztrev commented Jan 3, 2024

Ok, sounds good thanks!

@BlackthornYugen
Copy link
Member

@fitztrev thanks again for helping us to get the build working. The yarn change that resolved the issue was merged as part of #108

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

Successfully merging this pull request may close these issues.

cannot be moved on to the next page
2 participants