diff --git a/Dockerfile.autobuild b/Dockerfile.autobuild index 8b5f8fa..f514ce4 100644 --- a/Dockerfile.autobuild +++ b/Dockerfile.autobuild @@ -22,14 +22,17 @@ RUN yarn build # Required for other database options FROM python:3.9.12-slim-buster as base +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ + && if [ $(dpkg --print-architecture) = "arm64" -o $(dpkg --print-architecture) = "armhf" ]; then apt-get -y install apt-utils; fi \ && apt-get -y install gcc default-libmysqlclient-dev RUN pip --no-cache-dir install --user mysqlclient cx-Oracle # Final image FROM python:3.9.12-slim-buster +ARG DEBIAN_FRONTEND=noninteractive WORKDIR pinry RUN mkdir /data && chown -R www-data:www-data /data @@ -48,7 +51,7 @@ RUN apt-get update \ # Install Pillow dependencies && apt-get -y install libopenjp2-7 libjpeg-turbo-progs libjpeg62-turbo-dev libtiff5-dev libxcb1 \ # Needed to compile psycopg2 on arm (fallback for psycopg2-binary) - && if [ $(dpkg --print-architecture) = "arm64" -o $(dpkg --print-architecture) = "armhf" ]; then apt-get -y install libpq-dev gcc; fi \ + && if [ $(dpkg --print-architecture) = "arm64" -o $(dpkg --print-architecture) = "armhf" ]; then apt-get -y install apt-utils libpq-dev gcc; fi \ && rm -rf /var/lib/apt/lists/* \ && apt-get autoclean diff --git a/docker/build_docker.sh b/docker/build_docker.sh index 0a9b6f6..7b3147a 100755 --- a/docker/build_docker.sh +++ b/docker/build_docker.sh @@ -1,4 +1,5 @@ #!/bin/bash script_dir="$( dirname "${0}" )" -sudo docker build -t getpinry/pinry${@} "${script_dir}/../" -f "${script_dir}/../Dockerfile.autobuild" +sudo docker build -t getpinry/pinry${@} "${script_dir}/../" \ + -f "${script_dir}/../Dockerfile.autobuild" diff --git a/docker/build_docker_multiple_platform.sh b/docker/build_docker_multiple_platform.sh new file mode 100755 index 0000000..f04abb7 --- /dev/null +++ b/docker/build_docker_multiple_platform.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +script_dir="$( dirname "${0}" )" + +sudo docker buildx build \ + --push \ + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + -t getpinry/pinry:${@} "${script_dir}/../" \ + -f "${script_dir}/../Dockerfile.autobuild"