2020-08-04 05:37:29 +00:00
|
|
|
FROM ubuntu:latest
|
2020-08-02 20:15:13 +00:00
|
|
|
|
2020-08-04 05:37:29 +00:00
|
|
|
# Don't bother us for selections during install
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
|
|
|
|
|
|
|
# We work off /opt, the *nix way
|
2020-08-02 20:15:13 +00:00
|
|
|
WORKDIR /opt/
|
|
|
|
|
|
|
|
# need to figure out if arm64/arm64 32bit multilib/arm
|
|
|
|
COPY piframefleet/arch_detect.sh /opt/
|
|
|
|
|
|
|
|
# Install and base setup all the things
|
2020-08-04 05:37:29 +00:00
|
|
|
RUN apt update && apt upgrade -y && \
|
2020-08-04 06:26:28 +00:00
|
|
|
apt install -y python3 curl jq bash unzip nano git && \
|
2020-08-02 20:15:13 +00:00
|
|
|
ARCH=$(/opt/arch_detect.sh); \
|
|
|
|
echo "**** Detected arch: $ARCH ****" && \
|
|
|
|
S6_RELEASE=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/tags" \
|
|
|
|
| jq -r .[0].name); \
|
|
|
|
echo "**** s6-overlay release: ${S6_RELEASE} ****" && \
|
|
|
|
echo "**** Installing s6-overlay ****" && \
|
|
|
|
curl -L https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-${ARCH}.tar.gz \
|
|
|
|
-o /opt/s6-overlay.tar.gz && \
|
2020-08-04 05:37:29 +00:00
|
|
|
tar xzf /opt/s6-overlay.tar.gz -C / --exclude="./bin" && \
|
|
|
|
tar xzf /opt/s6-overlay.tar.gz -C /usr ./bin && \
|
|
|
|
echo "**** wireguard ****" && \
|
2020-08-04 06:26:28 +00:00
|
|
|
apt install -y build-essential ifupdown iproute2 iptables iputils-ping libc6 libelf-dev pkg-config && \
|
2020-08-04 05:37:29 +00:00
|
|
|
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
|
|
|
|
| jq -r .[0].name); \
|
|
|
|
git clone https://git.zx2c4.com/wireguard-tools /opt/wireguard-tools && \
|
|
|
|
cd /opt/wireguard-tools && \
|
|
|
|
git checkout "${WIREGUARD_RELEASE}" && \
|
|
|
|
make -C src -j$(nproc) && \
|
|
|
|
make -C src install && \
|
|
|
|
cd /opt && \
|
2020-08-02 20:15:13 +00:00
|
|
|
echo "**** syncthing ****" && \
|
2020-08-04 05:37:29 +00:00
|
|
|
curl -s https://syncthing.net/release-key.txt | apt-key add - && \
|
|
|
|
echo "deb https://apt.syncthing.net/ syncthing stable" | tee /etc/apt/sources.list.d/syncthing.list && \
|
|
|
|
apt update && apt install -y syncthing && \
|
2020-08-02 20:15:13 +00:00
|
|
|
echo "**** rclone ****" && \
|
|
|
|
curl https://rclone.org/install.sh | bash && \
|
|
|
|
echo "**** filebrowser ****" && \
|
|
|
|
curl -fsSL https://filebrowser.org/get.sh | bash && \
|
|
|
|
echo "**** ansible ****" && \
|
2020-08-04 05:37:29 +00:00
|
|
|
apt install -y python3-apt ansible ansible-lint ansible-doc && \
|
2020-08-02 20:15:13 +00:00
|
|
|
echo "**** cleanup ****" && \
|
2020-08-04 06:40:35 +00:00
|
|
|
rm /opt/arch_detect.sh && \
|
2020-08-02 20:15:13 +00:00
|
|
|
rm /opt/s6-overlay.tar.gz && \
|
2020-08-04 05:37:29 +00:00
|
|
|
rm -rf /opt/wireguard-tools && \
|
2020-08-04 06:26:28 +00:00
|
|
|
apt remove --purge -y build-essential pkg-config libelf-dev unzip && \
|
2020-08-04 05:37:29 +00:00
|
|
|
apt autoremove --purge -y && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2020-08-02 20:15:13 +00:00
|
|
|
|
2020-08-04 05:37:29 +00:00
|
|
|
# Copy the s6 related 'stuff' to the container
|
2020-08-02 20:15:13 +00:00
|
|
|
ADD /piframefleet/root/ /
|
|
|
|
|
2020-08-04 06:39:09 +00:00
|
|
|
# Ansible related 'stuff'
|
|
|
|
VOLUME /opt/ansible
|
|
|
|
|
2020-08-02 20:15:13 +00:00
|
|
|
# Wireguard related 'stuff'
|
|
|
|
ENV ENABLE_WIREGUARD=false
|
|
|
|
EXPOSE 51820/udp
|
|
|
|
VOLUME /lib/modules
|
|
|
|
|
|
|
|
# SyncThing related 'stuff'
|
|
|
|
ENV ENABLE_SYNCTHING=false
|
|
|
|
EXPOSE 8384/tcp
|
|
|
|
EXPOSE 22000/tcp
|
2020-08-03 22:24:11 +00:00
|
|
|
VOLUME /opt/syncthing
|
2020-08-02 20:15:13 +00:00
|
|
|
|
|
|
|
# FileBrowser related 'stuff'
|
|
|
|
ENV ENABLE_FILEBROWSER=false
|
|
|
|
EXPOSE 9191/tcp
|
|
|
|
VOLUME /opt/filebrowser
|
|
|
|
|
|
|
|
# General 'stuff'
|
|
|
|
VOLUME /opt/pictures
|
|
|
|
|
|
|
|
# Run s6-overlay as the init so we get services and similar
|
|
|
|
ENTRYPOINT [ "/init" ]
|