From 639be688493995074f49753e8b9e8ec5a00ef9c2 Mon Sep 17 00:00:00 2001 From: Aode Date: Sat, 15 Feb 2020 20:01:19 -0600 Subject: [PATCH] Build mastodon --- mastodon/Dockerfile.arm64v8 | 13 ++++++++----- mastodon/build.sh | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mastodon/Dockerfile.arm64v8 b/mastodon/Dockerfile.arm64v8 index aeed45d..b8c24c6 100644 --- a/mastodon/Dockerfile.arm64v8 +++ b/mastodon/Dockerfile.arm64v8 @@ -24,10 +24,11 @@ RUN apk add --no-cache whois nodejs yarn ca-certificates git bash \ ARG UID=1001 ARG GID=1001 RUN echo "Etc/UTC" > /etc/localtime && \ + mkdir -p /opt/mastodon && \ addgroup --gid $GID mastodon && \ - adduser -D -u 991 -G mastodon -h /opt/mastodon mastodon && \ + adduser -D -h /opt/mastodon -u 991 -G mastodon -h /opt/mastodon mastodon && \ echo "mastodon:`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 24 | mkpasswd -s -m sha-256`" | chpasswd && \ - chown -R mastodon:mastodon /opt + chown -R mastodon:mastodon /opt/mastodon # Install mastodon USER mastodon @@ -36,10 +37,12 @@ RUN git clone -b ${TAG} ${GIT_REPOSITORY} /opt/mastodon && \ # Install dependencies WORKDIR /opt/mastodon -RUN bundle config set deployment 'true' && \ +RUN mkdir -p /opt/mastodon/.config/yarn/global && \ + touch /opt/mastodon/.config/yarn/global/.yarnclean && \ + gem install bundler:1.17.2 && \ + bundle config set deployment 'true' && \ bundle install -j$(nproc) --without development test --with production && \ - yarn install --pure-lockfile && \ - yarn cache clean + yarn install --pure-lockfile # Compile assets RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder \ diff --git a/mastodon/build.sh b/mastodon/build.sh index 512ff95..61094a9 100755 --- a/mastodon/build.sh +++ b/mastodon/build.sh @@ -45,7 +45,7 @@ function build_image() { -t "${IMAGE}:latest" \ . - docker push "${IMAGE}:${TAG}-${VERSION}-${ARCH}" + docker push "${IMAGE}:$(echo ${TAG} | sed 's/\//-/g')-${VERSION}-${ARCH}" docker push "${IMAGE}:latest-${ARCH}" docker push "${IMAGE}:latest" }