xref: /curl/Dockerfile (revision a8268865)
1# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2#
3# SPDX-License-Identifier: curl
4
5# Self-contained build environment to match the release environment.
6#
7# Build and set the timestamp for the date corresponding to the release
8#
9#   docker build --build-arg SOURCE_DATE_EPOCH=1711526400 --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t curl/curl .
10#
11# Then run commands from within the build environment, for example
12#
13#   docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl autoreconf -fi
14#   docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./configure --without-ssl --without-libpsl
15#   docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl make
16#   docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/usr/src -w /usr/src curl/curl ./scripts/maketgz 8.7.1
17#
18# or get into a shell in the build environment, for example
19#
20#   docker run --rm -it -u $(id -u):$(id -g) -v (pwd):/usr/src -w /usr/src curl/curl bash
21#   $ autoreconf -fi
22#   $ ./configure --without-ssl --without-libpsl
23#   $ make
24#   $ ./scripts/maketgz 8.7.1
25
26# To update, get the latest digest e.g. from https://hub.docker.com/_/debian/tags
27FROM debian:bookworm-slim@sha256:c00d13c9aa5d1acfa44e5ababbb8d1f5ac53fa94bc2f993070ccea2dcaf5aa64
28
29RUN apt-get update -qq && apt-get install -qq -y --no-install-recommends \
30    build-essential make autoconf automake libtool git perl zip zlib1g-dev gawk && \
31    rm -rf /var/lib/apt/lists/*
32
33ARG UID=1000 GID=1000
34
35RUN groupadd --gid $UID dev && \
36    useradd --uid $UID --gid dev --shell /bin/bash --create-home dev
37
38USER dev:dev
39
40ARG SOURCE_DATE_EPOCH
41ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-1}
42