cd: too many arguments on centos:8, latest bash
xeor opened this issue · 3 comments
Given a Dockerfile
that looks like this:
FROM centos:8@sha256:6ab380c5a5acf71c1b6660d645d2cd79cc8ce91b38e0352cbf9561e050427baf
# Pinning by hash, since centos:8 doesn't have any sub-tags..
ENV S6_VERSION=v1.22.1.0
RUN curl https://keybase.io/justcontainers/key.asc | gpg --import \
&& curl -L --remote-name-all https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz{,.sig} \
&& gpg --verify s6-overlay-amd64.tar.gz.sig \
&& tar xzf /s6-overlay-amd64.tar.gz -C / --exclude="./bin" \
&& tar xzf /s6-overlay-amd64.tar.gz -C /usr ./bin
ENTRYPOINT ["/init"]
Then docker run --rm -it $(docker build -q .) bash
..
Things are fine, it exits normally...
But if I inside the container does dnf upgrade -y bash
, it all the sudden exits with /usr/bin/cd: line 2: cd: too many arguments
, and s6 is not running it's exit jobs...
If I try this on centos7, I get no error messages, but s6 is not running it's exit-stuff.. (cont-finish.d, s6-finish, ..)..
Does this mean that upgrading bash inside the container is generally a bad idea? Should it be supported? I didnt find any other issues on this.
This is still an issue, and there is still no comments.. Noone using centos 8, latest bash and s6?
I generally don't upgrade packages inside a running container.
But I think this would happen if you run the upgrade while building the image, too. It looks like dnf winds up replacing /usr/bin/cd
with a shell script.
Fortunately the latest execline package has execline-cd
available, I should be able to just replace all calls to cd
with execline-cd
and fix the issue. Though anybody with run
scripts relying on cd
being execline's cd will need to make similar changes.
Fixed in v2.0.0.1