Ubuntu 21.04 image problems with `test -x` and `which`
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Expired
|
Undecided
|
Unassigned |
Bug Description
Hi, I'm seeing strange behavior with the `ubuntu:21.04` as taken from docker.io.
Would not bet it is a problem with the image itself. In any case, help or pointers would be appreciated.
Here's the image:
$ sudo docker pull ubuntu:21.04
21.04: Pulling from library/ubuntu
Digest: sha256:
Status: Image is up to date for ubuntu:21.04
bash seems to be the default command
root@
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:00 /bin/bash
yet `test` doesn't find it to be executable:
root@
ok
root@
fail
Trying to rule out problems due to symlinks:
root@
fail
But that seems to be an issue with the shell builtin only:
root@
ok
Even `which` also behaves strangely:
root@
root@
apt fails because it doesn't find gpg (although it is installed):
root@
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Err:1 http://
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:2 http://
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:3 http://
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Err:4 http://
gpgv, gpgv2 or gpgv1 required for verification, but neither seems installed
Reading package lists... Done
W: GPG error: http://
E: The repository 'http://
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://
E: The repository 'http://
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://
E: The repository 'http://
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://
E: The repository 'http://
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
No such behavior occurs on the same host with the 20.04 or 20.10 images.
Could it be a Docker version problem? The host is a Debian 10 with Debian's Docker version:
$ apt policy docker.io
docker.io:
Installed: 18.09.1+
Candidate: 18.09.1+
Version table:
*** 18.09.1+
500 http://
100 /var/lib/
500 http://
$ sudo docker version
Client:
Version: 18.09.1
API version: 1.39
Go version: go1.11.6
Git commit: 4c52b90
Built: Sun, 21 Feb 2021 18:18:35 +0100
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 18.09.1
API version: 1.39 (minimum version 1.12)
Go version: go1.11.6
Git commit: 4c52b90
Built: Sun Jun 14 20:12:29 2020
OS/Arch: linux/amd64
Experimental: false
Hi,
What command are you using to create the container?
I took a look and was unable to run across those same issues as you. It looks like I was even using the same version of the docker image as you:
❯ docker --version be154cc2b1211a9 f98f4d708f42666 50c9129784d0485 d4507d9b0fa05d9 28b6 io/library/ ubuntu: 21.04 15:/# echo $SHELL 15:/# ls -l /bin/bash 15:/# test -e /bin/bash && echo ok || echo fail 15:/# test -x /bin/bash && echo ok || echo fail 15:/# which bash 15:/# apt update security. ubuntu. com/ubuntu hirsute-security InRelease [101 kB] archive. ubuntu. com/ubuntu hirsute InRelease [269 kB] security. ubuntu. com/ubuntu hirsute- security/ restricted amd64 Packages [114 kB] archive. ubuntu. com/ubuntu hirsute-updates InRelease [109 kB] security. ubuntu. com/ubuntu hirsute- security/ main amd64 Packages [97.5 kB] security. ubuntu. com/ubuntu hirsute- security/ multiverse amd64 Packages [1725 B] security. ubuntu. com/ubuntu hirsute- security/ universe amd64 Packages [208 kB] archive. ubuntu. com/ubuntu hirsute-backports InRelease [90.7 kB] archive. ubuntu. com/ubuntu hirsute/restricted amd64 Packages [111 kB] archive. ubuntu. com/ubuntu hirsute/main amd64 Packages [1791 kB] archive. ubuntu. com/ubuntu hirsute/universe amd64 Packages [16.8 MB] archive. ubuntu. com/ubuntu hirsute/multiverse amd64 Packages [252 kB] archive. ubuntu. com/ubuntu hirsute- updates/ main amd64 Packages [117 kB] archive. ubuntu. com/ubuntu hirsute- updates/ multiverse amd64 Packages [1725 B] archive. ubuntu. com/ubuntu hirsute- updates/ universe amd64 Packages [220 kB] archive. ubuntu. com/ubuntu hirsute- updates/ restricted amd64 Packages [114 kB] 15:/# exit
Docker version 20.10.2, build 20.10.2-0ubuntu2
~
❯ docker pull ubuntu:21.04
21.04: Pulling from library/ubuntu
c830499a6a92: Pull complete
b38f134463e2: Pull complete
2fd6a415fd8e: Pull complete
Digest: sha256:
Status: Downloaded newer image for ubuntu:21.04
docker.
~ took 6s
❯ docker run --rm -it ubuntu:21.04
root@57adb60296
/bin/bash
root@57adb60296
-rwxr-xr-x 1 root root 1404744 Mar 19 16:02 /bin/bash
root@57adb60296
ok
root@57adb60296
ok
root@57adb60296
/usr/bin/bash
root@57adb60296
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Get:13 http://
Get:14 http://
Get:15 http://
Get:16 http://
Fetched 20.4 MB in 4s (4960 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@57adb60296
exit
Marking incomplete for now until we have more steps to reproduce. Thanks!