Files
env-docker/Config/F-DroidRepo/Dockerfile

120 lines
3.2 KiB
Docker

# Build a container which hosts Android apps through an F-Droid repository.
# https://f-droid.org/en/docs/Setup_an_F-Droid_App_Repo/
# Base Image #
FROM debian:trixie-slim
# Setup #
ARG REPO
ENV REPO="$REPO"
ARG WEBROOT
ENV WEBROOT="$WEBROOT"
ARG FILE00
ENV FILE00="$FILE00"
ARG FILE01
ENV FILE01="$FILE01"
ARG FILE02
ENV FILE02="$FILE02"
ARG FILE03
ENV FILE03="$FILE03"
ARG FILE04
ENV FILE04="$FILE04"
ARG FILE05
ENV FILE05="$FILE05"
ARG FILE06
ENV FILE06="$FILE06"
ARG FILE07
ENV FILE07="$FILE07"
ARG FILE08
ENV FILE08="$FILE08"
ARG FILE09
ENV FILE09="$FILE09"
ARG FILE10
ENV FILE10="$FILE10"
ARG FILE11
ENV FILE11="$FILE11"
ARG FILE12
ENV FILE12="$FILE12"
ARG FILE13
ENV FILE13="$FILE13"
ARG FILE14
ENV FILE14="$FILE14"
ARG FILE15
ENV FILE15="$FILE15"
ARG FILE16
ENV FILE16="$FILE16"
ARG FILE17
ENV FILE17="$FILE17"
ARG FILE18
ENV FILE18="$FILE18"
ARG FILE19
ENV FILE19="$FILE19"
USER root
RUN mkdir -pv "$REPO"
WORKDIR "$REPO"
# Install Packages#
# https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/#debianubuntumintetc
RUN apt-get update && apt-get install -y sudo bash curl git vim nginx
COPY files/debian-backports.sources /etc/apt/sources.list.d/
RUN apt-get update && apt-get install -y -t trixie-backports fdroidserver
# Generate F-Droid Repo #
# Publish to Docker Hub? #
#TBD/TODO
# Configure F-Droid Repo #
#RUN sed -i 's/TBD/TODO/g' TBD.cfg
# Download Remote Files #
# TBD/TODO
# is a remove necessary to get updates if the files already exist?
# or do they need to have the version in the filename?
# or do they need to start having metadata in the apk?
#RUN bash -c 'rm -rfv "$REPO"/*'
RUN bash -c 'if [[ -n "$FILE00" ]]; then wget -P "$REPO" "$FILE00"; fi'
RUN bash -c 'if [[ -n "$FILE01" ]]; then wget -P "$REPO" "$FILE01"; fi'
RUN bash -c 'if [[ -n "$FILE02" ]]; then wget -P "$REPO" "$FILE02"; fi'
RUN bash -c 'if [[ -n "$FILE03" ]]; then wget -P "$REPO" "$FILE03"; fi'
RUN bash -c 'if [[ -n "$FILE04" ]]; then wget -P "$REPO" "$FILE04"; fi'
RUN bash -c 'if [[ -n "$FILE05" ]]; then wget -P "$REPO" "$FILE05"; fi'
RUN bash -c 'if [[ -n "$FILE06" ]]; then wget -P "$REPO" "$FILE06"; fi'
RUN bash -c 'if [[ -n "$FILE07" ]]; then wget -P "$REPO" "$FILE07"; fi'
RUN bash -c 'if [[ -n "$FILE08" ]]; then wget -P "$REPO" "$FILE08"; fi'
RUN bash -c 'if [[ -n "$FILE09" ]]; then wget -P "$REPO" "$FILE09"; fi'
RUN bash -c 'if [[ -n "$FILE10" ]]; then wget -P "$REPO" "$FILE10"; fi'
RUN bash -c 'if [[ -n "$FILE11" ]]; then wget -P "$REPO" "$FILE11"; fi'
RUN bash -c 'if [[ -n "$FILE12" ]]; then wget -P "$REPO" "$FILE12"; fi'
RUN bash -c 'if [[ -n "$FILE13" ]]; then wget -P "$REPO" "$FILE13"; fi'
RUN bash -c 'if [[ -n "$FILE14" ]]; then wget -P "$REPO" "$FILE14"; fi'
RUN bash -c 'if [[ -n "$FILE15" ]]; then wget -P "$REPO" "$FILE15"; fi'
RUN bash -c 'if [[ -n "$FILE16" ]]; then wget -P "$REPO" "$FILE16"; fi'
RUN bash -c 'if [[ -n "$FILE17" ]]; then wget -P "$REPO" "$FILE17"; fi'
RUN bash -c 'if [[ -n "$FILE18" ]]; then wget -P "$REPO" "$FILE18"; fi'
RUN bash -c 'if [[ -n "$FILE19" ]]; then wget -P "$REPO" "$FILE19"; fi'
# TBD / TODO
#RUN bash -c 'cd "$REPO" && fdroid update'
# Publish Repo to Web Root #
#TBD/TODO
# Start Container #
COPY files/main.sh /root/
RUN chmod 755 /root/main.sh
CMD /root/main.sh