概要
EC2で稼働させているMastodonでgit pull
した後にdocker-compose build
したら下記エラーが出てハマった。
環境
- AWS EC2(t2.medium)
- Ubuntu Server 16.04 LTS
エラー内容
ubuntu@ip-***-***-**-**:~/mastodon$ docker-compose build
redis uses an image, skipping
db uses an image, skipping
Building streaming
Step 1/9 : FROM ruby:2.4.1-alpine
---> 5eadd5d1419a
Step 2/9 : LABEL maintainer "https://github.com/tootsuite/mastodon" description "A GNU Social-compatible microblogging server"
---> Using cache
---> 95a4b711ef32
Step 3/9 : ENV RAILS_ENV production NODE_ENV production
---> Using cache
---> 499e95f00e13
Step 4/9 : EXPOSE 3000 4000
---> Using cache
---> 167a91f421f4
Step 5/9 : WORKDIR /mastodon
---> Using cache
---> e185ae07f027
Step 6/9 : COPY Gemfile Gemfile.lock package.json yarn.lock /mastodon/
---> Using cache
---> 460d49537428
Step 7/9 : RUN BUILD_DEPS=" postgresql-dev libxml2-dev libxslt-dev build-base" && apk -U upgrade && apk add $BUILD_DEPS nodejs libpq libxml2 libxslt ffmpeg file imagemagick && npm install -g npm@3 && npm install -g yarn && bundle install --deployment --without test development && yarn --ignore-optional && yarn cache clean && npm -g cache clean && apk del $BUILD_DEPS && rm -rf /tmp/* /var/cache/apk/*
---> Running in 68a8d45af6e8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/main: No such file or directory
WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.4/community: No such file or directory
WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory
OK: 21 MiB in 29 packages
WARNING: Ignoring APKINDEX.167438ca.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.a2e6dac0.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
build-base (missing):
required by: world[build-base]
ffmpeg (missing):
required by: world[ffmpeg]
file (missing):
required by: world[file]
imagemagick (missing):
required by: world[imagemagick]
libpq (missing):
required by: world[libpq]
libxml2 (missing):
required by: world[libxml2]
libxml2-dev (missing):
required by: world[libxml2-dev]
libxslt (missing):
required by: world[libxslt]
libxslt-dev (missing):
required by: world[libxslt-dev]
nodejs (missing):
required by: world[nodejs]
postgresql-dev (missing):
required by: world[postgresql-dev]
ERROR: Service 'streaming' failed to build: The command '/bin/sh -c BUILD_DEPS=" postgresql-dev libxml2-dev libxslt-dev build-base" && apk -U upgrade && apk add $BUILD_DEPS nodejs libpq libxml2 libxslt ffmpeg file imagemagick && npm install -g npm@3 && npm install -g yarn && bundle install --deployment --without test development && yarn --ignore-optional && yarn cache clean && npm -g cache clean && apk del $BUILD_DEPS && rm -rf /tmp/* /var/cache/apk/*' returned a non-zero code: 11
解決方法
alpinelinux.orgがダウンしているタイミングで実行していたのが悪かったみたい。
詳しくは下記 @noraworld さんのコメントを参照。