start to have a container to build stuff IN

This commit is contained in:
Alexander Mahr 2025-02-02 15:22:18 +01:00
commit afbee61fdf
4 changed files with 36 additions and 0 deletions

5
Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM debian:latest
RUN apt-get update -y && apt-get install -y build-essential
CMD ["make"]
WORKDIR "/source"

13
README.md Normal file
View file

@ -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
```

16
build.sh Executable file
View file

@ -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"

2
source/Makefile Normal file
View file

@ -0,0 +1,2 @@
all:
echo hallo