Skip to content

Example rust build using DHI fails #24362

@devklick

Description

@devklick

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

This page gives an example dockerfile for building rust applications using a Docker Hardened Image.

The dockerfile fails building when it tries adduser:

--------------------
  34 |     ARG UID=10001
  35 | >>> RUN adduser \
  36 | >>>     --disabled-password \
  37 | >>>     --gecos "" \
  38 | >>>     --home "/nonexistent" \
  39 | >>>     --shell "/sbin/nologin" \
  40 | >>>     --no-create-home \
  41 | >>>     --uid "${UID}" \
  42 | >>>     appuser
  43 |     USER appuser
--------------------

failed to solve: process "/bin/sh -c adduser     --disabled-password     --gecos \"\"     --home \"/nonexistent\"     --shell \"/sbin/nologin\"     --no-create-home     --uid \"${UID}\"     appuser" did not complete successfully: exit code: 1

The same problem does not occur when using another image such as debian:bookworm-slim, so perhaps the adduser command doesnt exist / doesnt work properly in the specified DHI.

Location

https://docs.docker.com/guides/rust/build-images/

Suggestion

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions