Merge branch 'asonix/changes' into v3.0.1-branch
This commit is contained in:
commit
7b77dc0949
32
Dockerfile
32
Dockerfile
|
@ -5,14 +5,15 @@ SHELL ["bash", "-c"]
|
||||||
|
|
||||||
# Install Node
|
# Install Node
|
||||||
ENV NODE_VER="12.11.1"
|
ENV NODE_VER="12.11.1"
|
||||||
|
ENV ARCH="x64"
|
||||||
RUN echo "Etc/UTC" > /etc/localtime && \
|
RUN echo "Etc/UTC" > /etc/localtime && \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt -y install wget python && \
|
apt -y install wget python && \
|
||||||
cd ~ && \
|
cd ~ && \
|
||||||
wget https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-x64.tar.gz && \
|
wget https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
tar xf node-v$NODE_VER-linux-x64.tar.gz && \
|
tar xf node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
rm node-v$NODE_VER-linux-x64.tar.gz && \
|
rm node-v$NODE_VER-linux-$ARCH.tar.gz && \
|
||||||
mv node-v$NODE_VER-linux-x64 /opt/node
|
mv node-v$NODE_VER-linux-$ARCH /opt/node
|
||||||
|
|
||||||
# Install jemalloc
|
# Install jemalloc
|
||||||
ENV JE_VER="5.2.1"
|
ENV JE_VER="5.2.1"
|
||||||
|
@ -89,16 +90,25 @@ RUN apt -y --no-install-recommends install \
|
||||||
file ca-certificates tzdata libreadline7 && \
|
file ca-certificates tzdata libreadline7 && \
|
||||||
apt -y install gcc && \
|
apt -y install gcc && \
|
||||||
ln -s /opt/mastodon /mastodon && \
|
ln -s /opt/mastodon /mastodon && \
|
||||||
gem install bundler && \
|
gem install bundler
|
||||||
rm -rf /var/cache && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Add tini
|
# Add tini
|
||||||
ENV TINI_VERSION="0.18.0"
|
ENV TINI_VERSION="0.18.0"
|
||||||
ENV TINI_SUM="12d20136605531b09a2c2dac02ccee85e1b874eb322ef6baf7561cd93f93c855"
|
ENV TINI_ARCH="amd64"
|
||||||
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini /tini
|
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TINI_ARCH} /tini
|
||||||
RUN echo "$TINI_SUM tini" | sha256sum -c -
|
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-${TINI_ARCH}.asc /tini.asc
|
||||||
RUN chmod +x /tini
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt -y --no-install-recommends install gpg gpg-agent dirmngr && \
|
||||||
|
rm -rf /var/cache && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN gpg --batch \
|
||||||
|
--keyserver hkp://p80.pool.sks-keyservers.net:80 \
|
||||||
|
--recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 && \
|
||||||
|
gpg --batch --verify /tini.asc /tini
|
||||||
|
|
||||||
|
RUN chmod +rx /tini
|
||||||
|
|
||||||
# Copy over mastodon source, and dependencies from building, and set permissions
|
# Copy over mastodon source, and dependencies from building, and set permissions
|
||||||
COPY --chown=mastodon:mastodon . /opt/mastodon
|
COPY --chown=mastodon:mastodon . /opt/mastodon
|
||||||
|
|
36
build-images.sh
Executable file
36
build-images.sh
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
TAG=$1
|
||||||
|
|
||||||
|
require_input() {
|
||||||
|
input=$1
|
||||||
|
name=$2
|
||||||
|
|
||||||
|
if [ "$input" == "" ]; then
|
||||||
|
echo "Input, $name, required but not present"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
require_input "$TAG" "container tag"
|
||||||
|
|
||||||
|
architectures=('arm64v8' 'arm32v7' 'amd64')
|
||||||
|
|
||||||
|
for architecture in "${architectures[@]}"; do
|
||||||
|
sed "s/FROM ubuntu/FROM $architecture\/ubuntu/g" Dockerfile > "Dockerfile-$architecture"
|
||||||
|
if [ "$architecture" == arm32v7 ]; then
|
||||||
|
sed -i'' 's/x64/armv7l/g' "Dockerfile-$architecture" # for node
|
||||||
|
sed -i'' 's/amd64/armhf/g' "Dockerfile-$architecture" # for tini
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$architecture" == arm64v8 ]; then
|
||||||
|
sed -i'' 's/x64/arm64/g' "Dockerfile-$architecture" # for node
|
||||||
|
sed -i'' 's/amd64/arm64/g' "Dockerfile-$architecture" # for tini
|
||||||
|
fi
|
||||||
|
|
||||||
|
buildah build-using-dockerfile -f "Dockerfile-$architecture" -t "$TAG-$architecture" .
|
||||||
|
|
||||||
|
rm "Dockerfile-$architecture"
|
||||||
|
done
|
Loading…
Reference in a new issue