Skip to content

Use hashes instead of version tags #22

@Letgamer

Description

@Letgamer

What about instead of:

# Build container
ARG GOVERSION=1.21.6
ARG ALPINEVERSION=3.19

The hashes of the containers are used like this:

ARG GOHASH=2523a6f68a0f515fe251aad40b18545155135ca6a5b2e61da8254df9153e3648 # golang:1.21.6-alpine3.19
FROM --platform=${BUILDPLATFORM} \
    golang@sha256:$GOHASH AS build

This would make the container more secure by guaranteeing that the images won't change unless the sha256 is updated manually, so no malicious code will be executed. Version tags on the other hand can be easily overwritten

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions