[ (aka test) not working properly in ubuntu:latest amd64 docker image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Invalid
|
Undecided
|
Tomáš Virtus |
Bug Description
My problem is two-fold.
1.
On an amd64 machine:
$ docker run -ti ubuntu:latest bash
# ls -l /usr/bin/ls
-rwxr-xr-x 1 root root 138208 Feb 7 16:03 /usr/bin/ls
# if [ -r /usr/bin/ls ]; then echo Jay; else echo Nay; fi
Nay
In other words, ls shows that the ls binary is readable, but "[ -r" does not agree. Note:
# which [
#
The same happens with ubuntu:impish and ubuntu:devel, but ubuntu:focal works as expected.
I tried a fresh install with Virtualbox, there things are as expected.
2.
On an Macbook Pro M1, with ubuntu:latest, "[ -r" works as expected. And:
# which [
/usr/bin/[
#
So, the amd64 image is not functionally identical to the arm64 one.
The digest is sha256:
I am not able to reproduce this behavior. Are you using the docker.io packages from the Ubuntu repository?
# docker run -it ubuntu:latest bash b6b83d3c3317944 20340093eb706a6 f152d9c1fa51b26 2d9bf34594887c2 c7ac c2:/# ls -l /usr/bin/ls c2:/# [[ -r /usr/bin/ls ]] && echo yes || echo no c2:/# if [[ -r /usr/bin/ls ]]; then echo yes; else echo no;fi c2:/# cat /etc/lsb-release RELEASE= 22.04 CODENAME= jammy DESCRIPTION= "Ubuntu 22.04 LTS" c2:/# which [
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
405f018f9d1d: Pull complete
Digest: sha256:
Status: Downloaded newer image for ubuntu:latest
root@b10efb7999
-rwxr-xr-x 1 root root 138208 Feb 7 16:03 /usr/bin/ls
root@b10efb7999
yes
root@b10efb7999
yes
root@b10efb7999
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
root@b10efb7999
/usr/bin/[