commit afbee61fdfd19af834818ff636a4e19d064a423f Author: Alexander Mahr Date: Sun Feb 2 15:22:18 2025 +0100 start to have a container to build stuff IN diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..18aa616 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM debian:latest +RUN apt-get update -y && apt-get install -y build-essential +CMD ["make"] +WORKDIR "/source" + diff --git a/README.md b/README.md new file mode 100644 index 0000000..5459105 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Building stuff in containers + +## Rationale / sought for Benefits + +1. "cleanliness", all dependencies can be setup / installed in container and do not needlessly remain after build +2. "less/no missing dependecies" +3. "hightened" reproducibility + +## Usage: + +``` +./build.sh +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..5afa5b5 --- /dev/null +++ b/build.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +TAG(){ + for CMD in xxh128sum sha1sum md5sum 'stat -c %Y' + do + RESULT="$($CMD Dockerfile 2>/dev/null)" && break + done + echo ${RESULT:0:16} +} + +IMAGENAME="build-sh--$(basename "$(dirname "$(realpath "$0")")")":"$(TAG)" + +test -z $(docker images -q "$IMAGENAME") && { +docker build --tag "$IMAGENAME" . +} +docker run --rm -it -v ./source:/source "$IMAGENAME" diff --git a/source/Makefile b/source/Makefile new file mode 100644 index 0000000..82daf9e --- /dev/null +++ b/source/Makefile @@ -0,0 +1,2 @@ +all: + echo hallo