Skip to content

Docker Security Overhaul: Consider using docker.io/library/rust:slim-trixie #1463

Closed

Description

@josecelano

UPDATE: We use the docker image docker.io/library/rust:trixie; however, we should try using the slim version. The less the better.

I think I once tried to use it but I got some errors.

I've just tried again and there is one error:

 => CANCELED [tester 4/7] RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | b  0.3s
 => [chef 3/4] RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash          0.1s
 => ERROR [chef 4/4] RUN cargo binstall --no-confirm cargo-chef cargo-nextest                                                                                                0.2s
------                                                                                                                                                                            
 > [chef 4/4] RUN cargo binstall --no-confirm cargo-chef cargo-nextest:
0.167 error: no such command: `binstall`
0.167 
0.167 help: a command with a similar name exists: `install`
0.167 
0.167 help: view all installed commands with `cargo --list`
0.167 help: find a package to install `binstall` with `cargo search cargo-binstall`
------
Containerfile:9
--------------------
   7 |     WORKDIR /tmp
   8 |     RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
   9 | >>> RUN cargo binstall --no-confirm cargo-chef cargo-nextest
  10 |     
  11 |     ## Tester Image
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo binstall --no-confirm cargo-chef cargo-nextest" did not complete successfully: exit code: 101

However, they could be easy to fix if we only need to install some tools.

Activity

  1. added
    - Admin -
    Optimization
    Security
    on Apr 14, 2025
  2. added theissue type on Apr 14, 2025
  3. josecelano commented on Apr 16, 2026

    @josecelano
    MemberAuthor

    We udgrade from Bookworm to Trixie in this #1629.

    I do not remember exactly which one I wanted to change, but I guess it was the builder stage (that is now trixie but not slim):

    # Torrust Tracker
    
    ## Builder Image
    FROM docker.io/library/rust:trixie AS chef
    WORKDIR /tmp
    RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
    RUN cargo binstall --no-confirm cargo-chef cargo-nextest
    
    ## Tester Image
    FROM docker.io/library/rust:slim-trixie AS tester
    WORKDIR /tmp
    

    Anyway, we need to check the security for all of them. See #1459. Especially the runtime "gcr.io/distroless/cc-debian13"


    2026-04-16T19:29:08+01:00	INFO	[vuln] Vulnerability scanning is enabled
    2026-04-16T19:29:08+01:00	INFO	[secret] Secret scanning is enabled
    2026-04-16T19:29:08+01:00	INFO	[secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
    2026-04-16T19:29:08+01:00	INFO	[secret] Please see https://trivy.dev/docs/v0.69/guide/scanner/secret#recommendation for faster secret detection
    2026-04-16T19:29:10+01:00	INFO	Detected OS	family="debian" version="13.4"
    2026-04-16T19:29:10+01:00	INFO	[debian] Detecting vulnerabilities...	os_version="13" pkg_num=13
    2026-04-16T19:29:10+01:00	INFO	Number of language-specific files	num=0
    2026-04-16T19:29:10+01:00	WARN	Using severities from other vendors for some vulnerabilities. Read https://trivy.dev/docs/v0.69/guide/scanner/vulnerability#severity-selection for details.
    
    Report Summary
    
    ┌─────────────────────────────────────────────┬────────┬─────────────────┬─────────┐
    │                   Target                    │  Type  │ Vulnerabilities │ Secrets │
    ├─────────────────────────────────────────────┼────────┼─────────────────┼─────────┤
    │ gcr.io/distroless/cc-debian13 (debian 13.4) │ debian │       11        │    -    │
    └─────────────────────────────────────────────┴────────┴─────────────────┴─────────┘
    Legend:
    - '-': Not scanned
    - '0': Clean (no security findings detected)
    
    
    gcr.io/distroless/cc-debian13 (debian 13.4)
    
    Total: 11 (UNKNOWN: 0, LOW: 7, MEDIUM: 4, HIGH: 0, CRITICAL: 0)
    
    ┌─────────┬──────────────────┬──────────┬──────────────┬─────────────────────────────┬───────────────┬──────────────────────────────────────────────────────────────┐
    │ Library │  Vulnerability   │ Severity │    Status    │      Installed Version      │ Fixed Version │                            Title                             │
    ├─────────┼──────────────────┼──────────┼──────────────┼─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
    │ libc6   │ CVE-2026-4046    │ MEDIUM   │ fix_deferred │ 2.41-12+deb13u2             │               │ glibc: glibc: Denial of Service via iconv() function with    │
    │         │                  │          │              │                             │               │ specific character sets...                                   │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4046                    │
    │         ├──────────────────┤          ├──────────────┤                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2026-4437    │          │ affected     │                             │               │ glibc: glibc: Incorrect DNS response parsing via crafted DNS │
    │         │                  │          │              │                             │               │ server response                                              │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4437                    │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2026-4438    │          │              │                             │               │ glibc: glibc: Invalid DNS hostname returned via              │
    │         │                  │          │              │                             │               │ gethostbyaddr functions                                      │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-4438                    │
    │         ├──────────────────┼──────────┤              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2010-4756    │ LOW      │              │                             │               │ glibc: glob implementation can cause excessive CPU and       │
    │         │                  │          │              │                             │               │ memory consumption due to...                                 │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2010-4756                    │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2018-20796   │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
    │         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2018-20796                   │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2019-1010022 │          │              │                             │               │ glibc: stack guard protection bypass                         │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010022                 │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2019-1010023 │          │              │                             │               │ glibc: running ldd on malicious ELF leads to code execution  │
    │         │                  │          │              │                             │               │ because of...                                                │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010023                 │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2019-1010024 │          │              │                             │               │ glibc: ASLR bypass using cache of thread stack and heap      │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010024                 │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2019-1010025 │          │              │                             │               │ glibc: information disclosure of heap addresses of           │
    │         │                  │          │              │                             │               │ pthread_created thread                                       │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-1010025                 │
    │         ├──────────────────┤          │              │                             ├───────────────┼──────────────────────────────────────────────────────────────┤
    │         │ CVE-2019-9192    │          │              │                             │               │ glibc: uncontrolled recursion in function                    │
    │         │                  │          │              │                             │               │ check_dst_limits_calc_pos_1 in posix/regexec.c               │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2019-9192                    │
    ├─────────┼──────────────────┼──────────┤              ├─────────────────────────────┼───────────────┼──────────────────────────────────────────────────────────────┤
    │ zlib1g  │ CVE-2026-27171   │ MEDIUM   │              │ 1:1.3.dfsg+really1.3.1-1+b1 │               │ zlib: zlib: Denial of Service via infinite loop in CRC32     │
    │         │                  │          │              │                             │               │ combine functions...                                         │
    │         │                  │          │              │                             │               │ https://avd.aquasec.com/nvd/cve-2026-27171                   │
    └─────────┴──────────────────┴──────────┴──────────────┴─────────────────────────────┴───────────────┴──────────────────────────────────────────────────────────────┘
  4. changed the title [-]Docker Security Overhaul: Consider using `docker.io/library/rust:slim-bookworm`[/-] [+]Docker Security Overhaul: Consider using `docker.io/library/rust:slim-slim-trixie`[/+] on Apr 29, 2026
  5. josecelano commented on Apr 29, 2026

    @josecelano
    MemberAuthor

    The trixie versions have the same vulnerabilities. So from the security point of view it does not matter if we update. It was not the case for the Bookworm when I opened this issue.

    Image
  6. added a commit that references this issue on Jun 10, 2026
  7. self-assigned this
    on Jul 20, 2026
  8. changed the title [-]Docker Security Overhaul: Consider using `docker.io/library/rust:slim-slim-trixie`[/-] [+]Docker Security Overhaul: Consider using `docker.io/library/rust:slim-trixie`[/+] on Jul 20, 2026
  9. added a commit that references this issue on Jul 21, 2026
  10. added a commit that references this issue on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

- Admin -OptimizationSecurity

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions