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

feat: shorten docker command arguments by leveraging CMD #35

Merged
merged 1 commit into from
Mar 14, 2023
Merged

feat: shorten docker command arguments by leveraging CMD #35

merged 1 commit into from
Mar 14, 2023

Conversation

kunish
Copy link
Member

@kunish kunish commented Mar 14, 2023

As the title suggests, this PR is to shorten docker command user arguments by adding default ENTRYPOINT and
CMD to Dockerfile, which is used in the CI/CD build steps.

Before

docker exec dae dae reload

After

docker exec dae reload

@kunish kunish requested a review from mzz2017 as a code owner March 14, 2023 08:59
@mzz2017
Copy link
Contributor

mzz2017 commented Mar 14, 2023

Thanks for your PR!

dae does not listen on port 2023 like dae-wing, thus we have no need to expose it.

And why we need an independent CMD [ ] ?

@kunish
Copy link
Member Author

kunish commented Mar 14, 2023

See this article, which explains in detail the main differences and usecases between these two Dockerfile commands.

In short

Use CMD to specify the default command to be executed when running a container from the image.

Use ENTRYPOINT to specify the main command to execute when the container starts.

@kunish
Copy link
Member Author

kunish commented Mar 14, 2023

dae does not listen on port 2023 like dae-wing, thus we have no need to expose it.

My mistake. I was confused with another project we are working on.

@mzz2017
Copy link
Contributor

mzz2017 commented Mar 14, 2023

@kunish Thank you for your explanation. I think it has been ready to merge.

@mzz2017 mzz2017 merged commit c28aea0 into daeuniverse:main Mar 14, 2023
@kunish kunish deleted the shorten-docker-arguments-by-leveraging-CMD branch March 14, 2023 09:21
@kunish
Copy link
Member Author

kunish commented Mar 14, 2023

Just a quick reminder, we need to also change the instructions on dockerhub README

@mzz2017
Copy link
Contributor

mzz2017 commented Mar 14, 2023

@kunish I'll do it later. Thanks.

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