start to have a container to build stuff IN
This commit is contained in:
commit
afbee61fdf
4 changed files with 36 additions and 0 deletions
5
Dockerfile
Normal file
5
Dockerfile
Normal 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
13
README.md
Normal 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
16
build.sh
Executable 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
2
source/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
all:
|
||||
echo hallo
|
Loading…
Add table
Reference in a new issue