Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

HOME env instantiated incorrectly when USER is configured as ID in Dockerfile #364

Open
Pectojin opened this issue Apr 19, 2021 · 0 comments

Comments

@Pectojin
Copy link

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.

Screenshots
image

Environments
This happens both when Makisu runs in our containerd k8s cluster and when I run Makisu locally in Docker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant