docker build Dockerfile Home Directory Ownership Lost After RUN useradd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
docker.io-app (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The following now fails
```
cd $(mktemp -d);
cat > Dockerfile << "END"
FROM ubuntu:22.04
ARG user=ubuntu
RUN useradd -U -m $user && [ "$(stat --format '%U' /home/$user)" = "$user" ]
RUN ls -al /home
USER ubuntu
WORKDIR /home/ubuntu
RUN stat "$(realpath .)"; [ "$(stat --format '%U' .)" = "$user" ]
END
docker build --force-rm .
```
Doesn't work with
Docker version 20.10.25, build 20.10.25-
Does work with
Docker version 20.10.21, build 20.10.21-
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: docker.io 20.10.25-
ProcVersionSign
Uname: Linux 5.19.0-50-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Fri Aug 4 01:58:26 2023
InstallationDate: Installed on 2023-07-25 (9 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: docker.io-app
UpgradeStatus: No upgrade log present (probably fresh install)
Status changed to 'Confirmed' because the bug affects multiple users.