Skip to content

Commit

Permalink
Add pre_build dependency system to move towards #360
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Alberty authored and jacobalberty committed Oct 16, 2020
1 parent 84f52fa commit f79335f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ RUN set -ex \

RUN mkdir -p /usr/unifi \
/usr/local/unifi/init.d \
/usr/unifi/init.d
/usr/unifi/init.d \
/usr/local/docker
COPY docker-entrypoint.sh /usr/local/bin/
COPY docker-healthcheck.sh /usr/local/bin/
COPY docker-build.sh /usr/local/bin/
COPY functions /usr/unifi/functions
COPY import_cert /usr/unifi/init.d/
COPY pre_build /usr/local/docker/pre_build
RUN chmod +x /usr/local/bin/docker-entrypoint.sh \
&& chmod +x /usr/unifi/init.d/import_cert \
&& chmod +x /usr/local/bin/docker-healthcheck.sh \
&& chmod +x /usr/local/bin/docker-build.sh
&& chmod +x /usr/local/bin/docker-build.sh \
&& chmod -R +x /usr/local/docker/pre_build

# Push installing openjdk-8-jre first, so that the unifi package doesn't pull in openjdk-7-jre as a dependency? Else uncomment and just go with openjdk-7.
RUN set -ex \
Expand Down
5 changes: 5 additions & 0 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb
apt-get update
echo "deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti" > /etc/apt/sources.list.d/20ubiquiti.list
tryfail apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 06E85760C0A52C50

if [ -d "/usr/local/docker/pre_build/$(dpkg --print-architecture)" ]; then
find "/usr/local/docker/pre_build/$(dpkg --print-architecture)" -type f -exec '{}' \;
fi

curl -L -o ./unifi.deb "${1}"
apt -qy install mongodb-org ./unifi.deb
rm -f ./unifi.deb
Expand Down
5 changes: 5 additions & 0 deletions pre_build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This folder is for adding build scripts for various architectures to apply quick fixes for building on other architectures.

To use you would create a subfolder (ie `armhf`, `amd64`, `arm64`) then place an appropriate shell script in that folder to build.

This directory was added to enable satisfying dependencies that aren't automatically satisfied by the distro (for ex: mongodb on armhf)

0 comments on commit f79335f

Please sign in to comment.