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

cmd/bash is confusingly named/used #1445

Closed
imjasonh opened this issue Oct 21, 2019 · 0 comments · Fixed by #1446
Closed

cmd/bash is confusingly named/used #1445

imjasonh opened this issue Oct 21, 2019 · 0 comments · Fixed by #1446

Comments

@imjasonh
Copy link
Member

Expected Behavior

Image named bash executes provided args using the Bash shell.

Actual Behavior

It invokes the args with sh -c (Bourne shell), not Bash. The image is based on busybox, whose default shell is ash. Busybox doesn't even include Bash:

$ docker run busybox bash
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown.

Additional Info

Since the details of the bash image are intended to be an internal implementation detail, one solution is to simply rename the image to something more correctly descriptive. Nothing that uses the image actually relies on Bash behavior, so we could just rename it to sh.

Also, provided examples for using the image are incorrect. Passing multiple string args will result in only the first one being interpreted, further args will be ignored:

$ docker run $KO_DOCKER_REPO/github.com/tektoncd/pipeline/cmd/bash -args echo hello world
{"level":"info","ts":1571672349.923307,"logger":"fallback-logger","caller":"bash/main.go:64","msg":"Successfully executed command \"sh -c echo\"; output \n"}
imjasonh added a commit to imjasonh/pipeline that referenced this issue Oct 21, 2019
- Base cmd/bash image on ubuntu, run specified args with "bash -c"
- Fail cmd/bash if extra args are passed -- these would have been ignored previously
- Fix examples for cmd/bash that passed extra args
- Update entrypoint image to be based on distroless (the default), since it doesn't actually need a shell
- Un-export unnecessarily exported types in entrypoint

Fixes tektoncd#1445
imjasonh added a commit to imjasonh/pipeline that referenced this issue Oct 21, 2019
- Base cmd/bash image on ubuntu, run specified args with "bash -c"
- Fail cmd/bash if extra args are passed -- these would have been ignored previously
- Fix examples for cmd/bash that passed extra args
- Update entrypoint image to be based on distroless (the default), since it doesn't actually need a shell
- Un-export unnecessarily exported types in entrypoint cmd and pkgs

Fixes tektoncd#1445
imjasonh added a commit to imjasonh/pipeline that referenced this issue Oct 21, 2019
- Base cmd/bash image on ubuntu, run specified args with `bash -c`
- Fail cmd/bash if extra args are passed -- these would have been ignored previously
- Fix examples for cmd/bash that passed extra args
- Update entrypoint image to be based on busybox, since it only needs `cp`
- Un-export unnecessarily exported types in entrypoint cmd and pkgs

Fixes tektoncd#1445
imjasonh added a commit to imjasonh/pipeline that referenced this issue Oct 21, 2019
- Base cmd/bash image on `bash` (based on `alpine`), run specified args with `bash -c`
- Fail cmd/bash if extra args are passed -- these would have been ignored previously
- Fix examples for cmd/bash that passed extra args
- Update entrypoint image to be based on busybox, since it only needs `cp`
- Un-export unnecessarily exported types in entrypoint cmd and pkgs

Fixes tektoncd#1445
tekton-robot pushed a commit that referenced this issue Oct 22, 2019
- Base cmd/bash image on `bash` (based on `alpine`), run specified args with `bash -c`
- Fail cmd/bash if extra args are passed -- these would have been ignored previously
- Fix examples for cmd/bash that passed extra args
- Update entrypoint image to be based on busybox, since it only needs `cp`
- Un-export unnecessarily exported types in entrypoint cmd and pkgs

Fixes #1445
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 a pull request may close this issue.

1 participant