Add files
This commit is contained in:
parent
a76f6a2196
commit
af97c5f829
8 changed files with 78 additions and 2 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
target/
|
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
# THIS FILE IS AUTOMATICALLY GENERATED BY BUILD.SH
|
||||
# TO MODIFY DOCKERFILES, SEE THE DIRECTORY NAMED "dockerfiles"\n
|
||||
|
||||
# dockerfiles/00-base
|
||||
FROM debian AS base
|
||||
RUN apt update
|
||||
RUN --mount=type=cache,target=/var/cache apt install -y build-essential libssl-dev zlib1g-dev autoconf
|
||||
|
||||
# dockerfiles/02-final
|
||||
FROM busybox:glibc
|
||||
|
||||
COPY tini /tini
|
||||
COPY utils/http-server-rs/target/release/http-server /bin
|
||||
COPY --from=base /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib
|
||||
|
||||
RUN mkdir -p /srv/repo
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["http-server", "--chdir", "/srv/repo"]
|
||||
ENTRYPOINT ["/tini", "--"]
|
|
@ -1,2 +1,2 @@
|
|||
# mini-fdroid
|
||||
smallest possible fdroid server container
|
||||
# minhttpd
|
||||
tiny http server, made to mimic* the usability of "python -m http.server"
|
38
build.sh
Executable file
38
build.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "# THIS FILE IS AUTOMATICALLY GENERATED BY BUILD.SH" >Dockerfile
|
||||
echo "# TO MODIFY DOCKERFILES, SEE THE DIRECTORY NAMED \"dockerfiles\"\n" >>Dockerfile
|
||||
|
||||
for f in dockerfiles/*; do
|
||||
echo -e "\n# $f" >>Dockerfile
|
||||
cat $f >>Dockerfile
|
||||
done
|
||||
|
||||
if ! command -v cargo 2 >&1 >/dev/null; then
|
||||
echo "[*] Rust is not installed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for f in utils/*; do
|
||||
echo "Building $(basename $f)..."
|
||||
|
||||
pushd $f
|
||||
cargo build -r
|
||||
popd
|
||||
done
|
||||
|
||||
CMD=""
|
||||
if command -v podman 2 >&1 >/dev/null; then
|
||||
echo "[*] Using podman"
|
||||
CMD="podman"
|
||||
elif command -v docker 2 >&1 >/dev/null; then
|
||||
echo "[*] Using docker"
|
||||
CMD="docker"
|
||||
else
|
||||
echo "[!] No CMD parser installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$CMD build . -t arson.pw/minhttpd
|
3
dockerfiles/00-base
Normal file
3
dockerfiles/00-base
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM debian AS base
|
||||
RUN apt update
|
||||
RUN --mount=type=cache,target=/var/cache apt install -y build-essential libssl-dev zlib1g-dev autoconf
|
12
dockerfiles/01-server
Normal file
12
dockerfiles/01-server
Normal file
|
@ -0,0 +1,12 @@
|
|||
FROM busybox:glibc
|
||||
|
||||
COPY tini /tini
|
||||
COPY utils/http-server-rs/target/release/http-server /bin
|
||||
COPY --from=base /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib
|
||||
|
||||
RUN mkdir -p /srv/repo
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["http-server", "--chdir", "/srv/repo"]
|
||||
ENTRYPOINT ["/tini", "--"]
|
BIN
tini
Executable file
BIN
tini
Executable file
Binary file not shown.
1
utils/http-server-rs
Submodule
1
utils/http-server-rs
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1a5cee437c8bc580251f563f7c216a787264da2e
|
Loading…
Add table
Reference in a new issue