slimtoolkit / slimtoolkit/slim

Slim with --include-exe doesn't preserve the executable

Open
#724 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.4k
Forks
841
PR merge metrics
No merged PRs in 30d

Description

Expected Behavior

--include-exe=mkdir results in a slim image that includes mkdir without needing to specify any other --include-* options or --exec.

I'm sorry if this is 'user error' because I didn't read the manual properly.


Actual Behavior

--include-exe=mkdir seems to have no impact at all and creates an image that does not include mkdir.

Slim container contents (from docker export)
.dockerenv
bin
dev/
dev/console
dev/pts/
dev/shm/
etc/
etc/host.conf
etc/hostname
etc/hosts
etc/mtab
etc/nsswitch.conf
etc/passwd
etc/pki/
etc/pki/ca-trust/
etc/pki/ca-trust/extracted/
etc/pki/ca-trust/extracted/openssl/
etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
etc/pki/ca-trust/extracted/pem/
etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
etc/pki/java/
etc/pki/java/cacerts
etc/pki/tls/
etc/pki/tls/cert.pem
etc/pki/tls/certs/
etc/pki/tls/certs/ca-bundle.crt
etc/pki/tls/certs/ca-bundle.trust.crt
etc/resolv.conf
etc/ssl/
etc/ssl/cert.pem
etc/ssl/certs/
etc/ssl/certs/ca-bundle.crt
lib
lib64
proc/
run/
sys/
tmp/
usr/
usr/bin/
usr/bin/bash
usr/bin/ld.so
usr/bin/sh
usr/lib/
usr/lib/.build-id/
usr/lib/.build-id/46/
usr/lib/.build-id/46/d8c77d92436bbcafcf16f6737ab9d6a16f3a38
usr/lib/.build-id/7a/
usr/lib/.build-id/7a/cbb41bf6f1b7d977f1b44675bf3ed213776835
usr/lib64/
usr/lib64/ld-linux-x86-64.so.2
usr/lib64/libc.so.6
usr/lib64/libnss_dns.so.2
usr/lib64/libnss_files.so.2
usr/lib64/libresolv.so.2
usr/lib64/libtinfo.so.6.2

Steps to Reproduce the Problem

The following bash script should reproduce things (based on Debian under WSL2):

#!/bin/bash
cat > Dockerfile << DOCKERFILE
FROM rockylinux:9
RUN dnf -qy install /usr/bin/mkdir
DOCKERFILE
docker run --rm \
  -v $(pwd):/code \
  -v /var/run/docker.sock:/var/run/docker.sock dslim/slim:1.40.11 \
  --crt-api-version 1.25 \
  build \
  --dockerfile Dockerfile \
  --dockerfile-context /code \
  --http-probe-off \
  --include-exe=mkdir \
  --tag test:slim

docker run --rm -it test:slim mkdir -pv /tmp/tmp/tmp

Specifications

  • Version: 1.40.11
  • Platform: Linux WR189341E94201 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux (Docker version 27.2.0, build 3ab4256)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied Dockerfile and slim build reproduction with --include-exe=mkdir, then trace how that option is handled during the build command. Done means the resulting image contains mkdir and docker run --rm -it test:slim mkdir -pv /tmp/tmp/tmp succeeds without additional include or exec options.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.