-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
test: bump up emqx_builder to add zsh to erlang container #13055
Conversation
@@ -316,7 +319,7 @@ set +e | |||
if [ "$STOP" = 'yes' ]; then | |||
$DC down --remove-orphans | |||
elif [ "$ATTACH" = 'yes' ]; then | |||
docker exec -it "$ERLANG_CONTAINER" bash | |||
docker exec -it -u root "$ERLANG_CONTAINER" zsh |
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.
emqx-builder installs zsh using root. Add .zshrc in /root/.zshrc
.Some docker-compose.yaml start erlang by the emqx user, which makes zsh unavailable.So if we start with attach, we use root directly.
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.
maybe can add /home/emqx/.zshrc
?
but why do we need zsh ?
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.
I think it's best to not run the shell as root, specially when developing, because it'll create lots of root-owned files in the host file system that then require root to modify/delete, which is very annoying.
@Rory-Z 's idea sounds good, or perhaps there's a way to run zsh
with the normal user?
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.
https://github.com/emqx/emqx/blob/master/.ci/docker-compose-file/docker-compose.yaml#L24
We already mount /emqx to emqx dev home.
Q1: How to add .zshrc
and .oh-my-zsh
to this dir.
Q2: Sometime we use root to run, if we add .zshrc to emqx user not root, how to enable zsh when use root user ?
https://github.com/emqx/emqx/blob/master/.ci/docker-compose-file/docker-compose.yaml#L31
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.
but why do we need zsh ?
This builder image is only used for development and running CI tests. It will not be released to users. So adding zsh(oh-my-zsh) is to improve the development experience.
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.
If just improve the development experience, maybe we can add .zshrc
by ourself, because just install zsh is not enought, must have a good zshrc to have a good experience.
Other: There may be some differences between zsh and bash in subtle places. Please force our scripts to use bash.
Fixes
No need to test, this just adds zsh to the development erlang docker image for convenient development and debugging.
emqx/emqx-builder#111
Release version: v/e5.8.0
Summary
PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update