some basics for the good bois

This commit is contained in:
piecka 2025-02-26 10:57:14 +01:00
parent ceb343f038
commit 0b3bcc5be6
11 changed files with 143 additions and 0 deletions

12
basics/Dockerfile Normal file
View file

@ -0,0 +1,12 @@
# Dokumenation: https://docs.docker.com/reference/dockerfile/
# FROM debian:trixie-slim
FROM archlinux:latest
WORKDIR /root/app
COPY ./test.sh .
RUN chmod +x test.sh
ENTRYPOINT ["/bin/bash", "-c", "/root/app/test.sh"]

15
basics/build.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
# ─< Check if the given command exists silently >─────────────────────────────────────────
command_exists() {
command -v "$@" >/dev/null 2>&1
}
NAME="testimage"
TAG="latest"
if command_exists docker; then
if [ -e Dockerfile ]; then
docker build -t "${NAME}:${TAG}" .
fi
fi

3
basics/compose.yml Normal file
View file

@ -0,0 +1,3 @@
services:
app:
build: .

4
basics/test.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
echo "Hallo von Docker"
cat /etc/os-release