mirror of https://github.com/stashapp/stash.git
build arm and x86_64 docker containers (#1097)
This commit is contained in:
parent
deebeab9e8
commit
3f9b395b89
20
.travis.yml
20
.travis.yml
|
@ -12,6 +12,24 @@ env:
|
||||||
global:
|
global:
|
||||||
- GO111MODULE=on
|
- GO111MODULE=on
|
||||||
before_install:
|
before_install:
|
||||||
|
- set -e
|
||||||
|
# Configure environment so changes are picked up when the Docker daemon is restarted after upgrading
|
||||||
|
- echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json
|
||||||
|
- export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
|
# Upgrade to Docker CE 19.03 for BuildKit support
|
||||||
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||||
|
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
||||||
|
- sudo apt-get update
|
||||||
|
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
|
||||||
|
# install binfmt docker container, this container uses qemu to run arm programs transparently allowng docker to build arm 6,7,8 containers.
|
||||||
|
- docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
|
||||||
|
# Show info to simplify debugging and create a builder that can build the platforms we need
|
||||||
|
- docker info
|
||||||
|
- docker buildx create --name builder --use
|
||||||
|
- docker buildx inspect --bootstrap
|
||||||
|
- docker buildx ls
|
||||||
|
|
||||||
|
install:
|
||||||
- echo -e "machine github.com\n login $CI_USER_TOKEN" > ~/.netrc
|
- echo -e "machine github.com\n login $CI_USER_TOKEN" > ~/.netrc
|
||||||
- nvm install 12
|
- nvm install 12
|
||||||
- travis_retry make pre-ui
|
- travis_retry make pre-ui
|
||||||
|
@ -61,7 +79,7 @@ deploy:
|
||||||
# docker image build for develop release
|
# docker image build for develop release
|
||||||
- provider: script
|
- provider: script
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
script: bash ./docker/ci/x86_64/docker_push.sh development-x86_64
|
script: bash ./docker/ci/x86_64/docker_push.sh development
|
||||||
on:
|
on:
|
||||||
repo: stashapp/stash
|
repo: stashapp/stash
|
||||||
branch: develop
|
branch: develop
|
||||||
|
|
|
@ -1,25 +1,17 @@
|
||||||
|
FROM --platform=$BUILDPLATFORM ubuntu:20.04 AS prep
|
||||||
# must be built from /dist directory
|
ARG TARGETPLATFORM
|
||||||
|
|
||||||
FROM ubuntu:20.04 as prep
|
|
||||||
LABEL MAINTAINER="https://discord.gg/Uz29ny"
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get -y install curl xz-utils && \
|
|
||||||
apt-get autoclean -y && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
COPY stash-* /
|
||||||
|
RUN if [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then BIN=stash-pi; \
|
||||||
RUN curl --http1.1 -o /ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && \
|
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then BIN=stash-linux-arm32v7; \
|
||||||
tar xf /ffmpeg.tar.xz && \
|
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then BIN=stash-linux-arm64v8; \
|
||||||
rm ffmpeg.tar.xz && \
|
elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then BIN=stash-linux; \
|
||||||
mv /ffmpeg*/ /ffmpeg/
|
fi; \
|
||||||
|
mv $BIN /stash
|
||||||
FROM ubuntu:20.04 as app
|
FROM ubuntu:20.04 as app
|
||||||
RUN apt-get update && apt-get -y install ca-certificates
|
run apt update && apt install -y python3 python3 python-is-python3 python3-requests ffmpeg && rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=prep /ffmpeg/ffmpeg /ffmpeg/ffprobe /usr/bin/
|
COPY --from=prep /stash /usr/bin/
|
||||||
COPY /stash-linux /usr/bin/stash
|
|
||||||
|
|
||||||
EXPOSE 9999
|
EXPOSE 9999
|
||||||
CMD ["stash"]
|
CMD ["stash"]
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOCKER_TAG=$1
|
DOCKER_TAG=$1
|
||||||
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
|
|
||||||
# must build the image from dist directory
|
# must build the image from dist directory
|
||||||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push --output type=image,name=stashapp/stash:$DOCKER_TAG,push=true -f docker/ci/x86_64/Dockerfile dist/
|
||||||
docker build -t stashapp/stash:$DOCKER_TAG -f ./docker/ci/x86_64/Dockerfile ./dist
|
|
||||||
|
|
||||||
docker push stashapp/stash:$DOCKER_TAG
|
|
||||||
|
|
Loading…
Reference in New Issue