bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.03k stars 4.36k forks source link

Unable to run command when building images based on bitnami/thanos #67861

Open RedbeanGit opened 2 weeks ago

RedbeanGit commented 2 weeks ago

Name and Version

bitnami/thanos:0.35.1-debian-12-r1

What architecture are you using?

None

What steps will reproduce the bug?

  1. Create any Dockerfile based on bitnami/thanos image which needs to run a command:
FROM bitnami/thanos:0.35.1-debian-12-r1

RUN echo "This is a command that will fail"
  1. Try to build the image:
docker build -t mythanos .
  1. See the following error showing: unable to find user 1001: invalid argument

What is the expected behavior?

Docker should be able to find the user 1001 and run commands at build time using the default user.

What do you see instead?

Build error:

------
 > [2/2] RUN echo "This is a command that will fail":
------
Dockerfile:3
--------------------
   1 |     FROM bitnami/thanos:0.35.1-debian-12-r1
   2 |
   3 | >>> RUN echo "This is a command that will fail"
   4 |
--------------------
ERROR: failed to solve: process "/bin/sh -c echo \"This is a command that will fail\"" did not complete successfully: unable to find user 1001: invalid argument

I also tested with root user using USER root clause but it fails too.

carrodher commented 1 week ago

Note that bitnami/thanos is a scratch -an explicitly empty- container image. There are some applications, like Thanos, consisting of a single binary that doesn't need to have a fully operational distro.

RedbeanGit commented 1 week ago

Note that bitnami/thanos is a scratch -an explicitly empty- container image. There are some applications, like Thanos, consisting of a single binary that doesn't need to have a fully operational distro.

Is it linked to the "user not found" error I'm seeing? Scratch based image don't have any user?

Thanks in advance.