HOME env instantiated incorrectly when USER is configured as ID in Dockerfile
Pectojin opened this issue · 0 comments
Describe the bug
We have some constraints on our k8s environment, which requires us to declare our user by ID instead of name. This normally works fine, when buidling with Docker or Kaniko, but I've observed that Makisu doesn't get this quite right. The container starts as the intended user but the HOME env variable is wrong, breaking things like simply compiling a go binary.
To Reproduce
Using ubuntu as a base, then creating a user on ID 1000, and setting USER 1000
:
FROM ubuntu:latest
RUN adduser builder --uid 1000 --disabled-password --home=/home/builder --gecos ""
USER 1000
RUN whoami
RUN env
Which, when built, will print:
% whoami
builder
% env
HOME=/home/1000
...
Expected behavior
When building the above dockerfile I expect:
% whoami
builder
% env
HOME=/home/builder
...
Which is what I get using Kaniko or Docker to build.
Environments
This happens both when Makisu runs in our containerd k8s cluster and when I run Makisu locally in Docker.