8000 Make docker build produce a runnable wait-for image. by gesellix · Pull Request #2 · eficode/wait-for · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make docker build produce a runnable wait-for image. #2

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

Merged
merged 7 commits into from
Jan 9, 2023

Conversation

gesellix
Copy link

This change adds a multi-stage build so that the resulting Docker image is a suitable base for a runtime container. It would be nice if you could add an automated build on the Docker Hub.

greygore added a commit to greygore/wait-for that referenced this pull request Jan 5, 2018
Adapted from [gesellix's PR](eficode#2)
@gesellix
Copy link
Author

This is now rebased on top of the recent changes.

Copy link
@Addono Addono left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this again 😄

I'm happy with adding support for having an official Docker image. Having the Dockerfile checked-in would be a good first step, creating CI/CD for publishing the image is something we can leave for another PR.

@gesellix
Copy link
Author

Thanks for looking into this again 😄

:)

I have to admit that the update was a bit rough. After your review I had a deeper look and it seems like some other issues have to be fixed. I'm going to update the pull request so you can review again.

@gesellix gesellix requested a review from Addono December 23, 2022 16:55
.gitattributes Outdated
@@ -0,0 +1 @@
wait-for text eol=lf
Copy link

Choose a reason for hiding this comment

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

Do we need this? I haven't had issues so far with line-endings nor heard anyone else about it.

If we need it, can we then set it for the entire repo? It would be the preferred line-ending for all files anyway, nothing specific to the wait-for script.

Suggested change
wait-for text eol=lf
* text=auto

https://www.git-scm.com/docs/gitattributes#_end_of_line_conversion

Copy link
Author

Choose a reason for hiding this comment

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

I'm sometimes working on Windows and I didn't configure my eol conversion globally. The local working copy failed to work in combination with the Docker container based tests. I'm going to move this change to a dedicated issue and we can continue the discussion over there.

@gesellix
Copy link
Author
gesellix commented Jan 8, 2023

Sorry for the forced pushes - I hope they won't confuse you too much. I felt that the commits had been too confusing after the reverts for #100 and the .gitattributes.

Copy link
@Addono Addono left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

But, I assume it still needs #100 for tests to pass, right?

@Addono
Copy link
Addono commented Jan 9, 2023

#100 is in main now, if you can rebase on it then I'm assuming the tests will pass and we're ready to merge 🥳

@gesellix gesellix requested a review from Addono January 9, 2023 11:42
@gesellix
Copy link
Author
gesellix commented Jan 9, 2023

@Addono I think this is complete now. You're probably going to merge with a squash commit? I'm asking, because I only now read about the contributing guidelines in the Readme and that conventional commit messages are required 😅 If you prefer to keep each commit, I can certainly update the commit messages.

@gesellix
Copy link
Author
gesellix commented Jan 9, 2023

I added another commit 801d014 to reflect the Dockerfile changes in the Readme.

@Addono
Copy link
Addono commented Jan 9, 2023

@Addono I think this is complete now. You're probably going to merge with a squash commit? I'm asking, because I only now read about the contributing guidelines in the Readme and that conventional commit messages are required 😅 If you prefer to keep each commit, I can certainly update the commit messages.

Yeah, I was planning on squashing it anyway. That's one reason why I wanted to take the unrelated changes in a separate commit :)

@Addono Addono merged commit a93c5f7 into eficode:master Jan 9, 2023
@Addono
Copy link
Addono commented Jan 9, 2023

Thanks @gesellix, here we are over 5 years later 😅 . But finally it landed 😄 .

For now, I merged it in as a non-release triggering commit, because I would like to keep our semantic-versioning to target the main script itself.

@gesellix gesellix deleted the multi-stage-build branch January 9, 2023 15:45
@gesellix
Copy link
Author
gesellix commented Jan 9, 2023

Yeah, 5 years later and still relevant. So thanks for maintaining the script and many thanks for the constructive feedback in this pull request! :)

Next up: an official Docker Image at the Docker Hub. Do you think this might become available in, say, 5 years? 😬 🤪 😉

@Addono
Copy link
Addono commented Jan 9, 2023

Next up: an official Docker Image at the Docker Hub. Do you think this might become available in, say, 5 years? 😬 🤪 😉

🤭 Hopefully 🤞

Pushing the container to a registry is technically not that hard, but at least for Docker Hub I need to get access to the Eficode organization, which is a bit "dusty". After that it's less than an hour work.

Otherwise, GitHub Packages could also be an option 🤷 .

@gesellix
Copy link
Author
gesellix commented Jan 9, 2023

dusty

🌁 ;)

I'm unsure if GitHub Packages would be convenient from the users' perspective. AFAIK GitHub requires authentication, while Docker Hub works without authentication (most of the time). That said: GitHub Packages are a step forward!👍

@Addono
Copy link
Addono commented Jan 9, 2023

Yeah, I know. Tripped me up the first time trying to use a GH-hosted container image too.

Although nowadays "on my local machine it just works", which means there's no problem with that road anyway, right? 😉

Pushing to both wouldn't be hard either. Automate once, run forever 😄

@Addono
Copy link
Addono commented Jan 12, 2023

And we're live! 🚀
https://hub.docker.com/r/eficode/wait-for

It's auto-building latest from master and each new tag. Since we don't have any tag pointing to a version with this PR included, you cannot yet pin it on the tag 😞 . But the good news is that that will fix itself in due time 😄 .

For now, I recommend pinning your version using SHAs. Later the tags should be immutable - don't think we will enforce it but the automation won't build new images for old tags, so effectively it should be.

One thing which is still todo is adding documentation on this new way to use the container. Another day though.

@gesellix
Copy link
Author

That's great, thanks a lot!

@gesellix
Copy link
Author
gesellix commented Jan 12, 2023

Only as a thought, I'm unsure if this is an issue: the image at eficore/wait-for is built for linux/amd64, which might be an issue on Apple M1 (linux/arm64). I have to check if a multi-platform image is necessary, but I guess it won't.

edit: works flawlessly on Apple M1 :)

@Addono
Copy link
Addono commented Jan 12, 2023

Only as a thought, I'm unsure if this is an issue: the image at eficore/wait-for is built for linux/amd64, which might be an issue on Apple M1 (linux/arm64). I have to check if a multi-platform image is necessary, but I guess it won't.

edit: works flawlessly on Apple M1 :)

Good 😄 , because Docker Hub's own auto-build infra doesn't seem to support it 😇

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.

2 participants
0