75 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			2.4 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"
 | 
						|
 | 
						|
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 sudo bash curl git vim nginx
 | 
						|
COPY files/debian-backports.sources /etc/apt/sources.list.d/
 | 
						|
RUN apt-get update && apt-get install -t trixie-backports fdroidserver
 | 
						|
 | 
						|
# Generate F-Droid Repo #
 | 
						|
 | 
						|
 | 
						|
# Publish? #
 | 
						|
 | 
						|
#TBD/TODO
 | 
						|
 | 
						|
# Configure F-Droid Repo #
 | 
						|
 | 
						|
RUN sed -i 's/TBD/TODO/g' TBD.cfg
 | 
						|
 | 
						|
# Download Files #
 | 
						|
 | 
						|
# TBD/TODO: is a remove necessary to get updates if the files already exist?
 | 
						|
#RUN bash -c 'rm -rfv "$REPO"/*'
 | 
						|
 | 
						|
RUN bash -c 'if [[ -n  "$FILE0" ]]; then curl  "$FILE0" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE1" ]]; then curl  "$FILE1" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE2" ]]; then curl  "$FILE2" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE3" ]]; then curl  "$FILE3" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE4" ]]; then curl  "$FILE4" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE5" ]]; then curl  "$FILE5" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE6" ]]; then curl  "$FILE6" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE7" ]]; then curl  "$FILE7" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE8" ]]; then curl  "$FILE8" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n  "$FILE9" ]]; then curl  "$FILE9" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE10" ]]; then curl "$FILE10" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE11" ]]; then curl "$FILE11" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE12" ]]; then curl "$FILE12" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE13" ]]; then curl "$FILE13" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE14" ]]; then curl "$FILE14" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE15" ]]; then curl "$FILE15" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE16" ]]; then curl "$FILE16" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE17" ]]; then curl "$FILE17" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE18" ]]; then curl "$FILE18" "$REPO"/; fi'
 | 
						|
RUN bash -c 'if [[ -n "$FILE19" ]]; then curl "$FILE19" "$REPO"/; fi'
 | 
						|
 | 
						|
RUN bash -c 'cd "$REPO" && fdroid update'
 | 
						|
 | 
						|
# Publish Repo to Web Root #
 | 
						|
 | 
						|
#TBD/TODO
 | 
						|
 | 
						|
# Start Container #
 | 
						|
 | 
						|
CMD sleep 5 \
 | 
						|
 && tail -F /var/mail/* & \
 | 
						|
 && tail -F /var/log/nginx/* & \
 | 
						|
 && wait -n
 |