Compare commits

...

17 Commits

Author SHA1 Message Date
Tom Moor b180bb334c 0.63.0-0 2022-04-09 20:47:02 -07:00
Tom Moor f7ade85785 Merge branch 'main' of https://github.com/Yggdrasil80/outline into Yggdrasil80-main 2022-04-09 20:46:34 -07:00
Yggdrasil80 0ea38f63cf Merge branch 'outline:main' into main 2022-03-29 21:35:08 +02:00
Yggdrasil80 5926ae4f7b fixed multiarch CI 2022-03-29 21:34:38 +02:00
Yggdrasil80 24287d3f25 fix context issues 2022-03-28 17:01:48 +02:00
Yggdrasil80 40a158a8c2 remove useless platforms, and keep only most used to reduce CI duration 2022-03-28 16:52:36 +02:00
Yggdrasil80 a3564de5fb fix docker buildx multiarch auto removing 2022-03-28 16:42:30 +02:00
Yggdrasil80 a43f01e694 Merge branch 'outline:main' into main 2022-03-28 11:24:49 +02:00
Yggdrasil80 ac54e787be add timeout to avoir errors 2022-03-20 00:47:02 +01:00
Yggdrasil80 8120076345 fix node:16 image not supported on arm/v5 and arm/v6 2022-03-20 00:35:42 +01:00
Yggdrasil80 60b9883d56 fix misstake on qemu image name 2022-03-20 00:23:16 +01:00
Yggdrasil80 f2e4656a15 Merge branch 'outline:main' into main 2022-03-19 13:42:53 +01:00
Yggdrasil80 8e638f672e fix: new cimg orbs not working with this config 2022-03-19 13:41:56 +01:00
Yggdrasil80 69cfb69749 fix: install missing docker buildx 2022-03-19 13:39:32 +01:00
Yggdrasil80 03c524c05c Merge branch 'outline:main' into main 2022-03-18 08:34:28 +01:00
Yggdrasil80 267b276324 add arm64 docker image build 2022-03-17 20:02:07 +01:00
Yggdrasil80 8a123b2d81 Add arm64 docker image build 2022-03-17 15:56:53 +01:00
4 changed files with 54 additions and 88 deletions
+27 -56
View File
@@ -25,6 +25,7 @@ executors:
docker-publisher:
environment:
IMAGE_NAME: outlinewiki/outline
BASE_IMAGE_NAME: outlinewiki/outline-base
docker:
- image: cimg/base
@@ -97,50 +98,36 @@ jobs:
- setup_remote_docker:
version: 20.10.6
- run:
name: Build Docker image
command: docker build -t $IMAGE_NAME:latest .
- run:
name: Archive Docker image
command: docker save -o image.tar $IMAGE_NAME
- persist_to_workspace:
root: .
paths:
- ./image.tar
publish-latest:
executor: docker-publisher
steps:
- attach_workspace:
at: /tmp/workspace
- setup_remote_docker:
version: 20.10.6
- run:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
- run:
name: Publish Docker Image to Docker Hub
name: Install Docker buildx
command: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
IMAGE_TAG=${CIRCLE_TAG/v/''}
docker tag $IMAGE_NAME:latest $IMAGE_NAME:$IMAGE_TAG
docker push $IMAGE_NAME:latest
docker push $IMAGE_NAME:$IMAGE_TAG
publish-tag:
executor: docker-publisher
steps:
- attach_workspace:
at: /tmp/workspace
- setup_remote_docker:
version: 20.10.6
mkdir -p ~/.docker/cli-plugins
url="https://github.com/docker/buildx/releases/download/v0.8.0/buildx-v0.8.0.linux-amd64"
curl -sSL -o ~/.docker/cli-plugins/docker-buildx $url
chmod a+x ~/.docker/cli-plugins/docker-buildx
- run:
name: Load archived Docker image
command: docker load -i /tmp/workspace/image.tar
name: Enable Docker buildx
command: export DOCKER_CLI_EXPERIMENTAL=enabled
- run:
name: Publish Docker Image to Docker Hub
name: Initialize Docker buildx
command: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
IMAGE_TAG=${CIRCLE_TAG/v/''}
docker tag $IMAGE_NAME:latest $IMAGE_NAME:$IMAGE_TAG
docker push $IMAGE_NAME:$IMAGE_TAG
docker buildx install
docker context create docker-multiarch
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name docker-multiarch --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x docker-multiarch
docker buildx inspect --builder docker-multiarch --bootstrap
docker buildx use docker-multiarch
- run:
name: Build base image
command: docker build -f Dockerfile.base -t $BASE_IMAGE_NAME:latest --load .
- run:
name: Login to Docker Hub
command: echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Publish base Docker Image to Docker Hub
command: docker push $BASE_IMAGE_NAME:latest
- run:
name: Build and push Docker image
command: docker buildx build -t $IMAGE_NAME:latest -t $IMAGE_NAME:${CIRCLE_TAG/v/''} --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x --push .
workflows:
version: 2
@@ -172,19 +159,3 @@ workflows:
only: /^v.*/
branches:
ignore: /.*/
- publish-latest:
requires:
- build-image
filters:
tags:
only: /^v\d+\.\d+\.\d+$/
branches:
ignore: /.*/
- publish-tag:
requires:
- build-image
filters:
tags:
only: /^v\d+\.\d+\.\d+-.*$/
branches:
ignore: /.*/
+8 -31
View File
@@ -1,45 +1,22 @@
# syntax=docker/dockerfile:1.2
ARG APP_PATH=/opt/outline
FROM node:16-alpine AS deps-common
ARG APP_PATH
WORKDIR $APP_PATH
COPY ./package.json ./yarn.lock ./
# ---
FROM deps-common AS deps-dev
RUN yarn install --no-optional --frozen-lockfile && \
yarn cache clean
# ---
FROM deps-common AS deps-prod
RUN yarn install --production=true --frozen-lockfile && \
yarn cache clean
# ---
FROM node:16-alpine AS builder
FROM outlinewiki/outline-base as base
ARG APP_PATH
WORKDIR $APP_PATH
COPY . .
COPY --from=deps-dev $APP_PATH/node_modules ./node_modules
ARG CDN_URL
RUN yarn build
# ---
FROM node:16-alpine AS runner
FROM node:16.14.2-alpine3.15 AS runner
ARG APP_PATH
WORKDIR $APP_PATH
ENV NODE_ENV production
COPY --from=builder $APP_PATH/build ./build
COPY --from=builder $APP_PATH/server ./server
COPY --from=builder $APP_PATH/public ./public
COPY --from=builder $APP_PATH/.sequelizerc ./.sequelizerc
COPY --from=deps-prod $APP_PATH/node_modules ./node_modules
COPY --from=builder $APP_PATH/package.json ./package.json
COPY --from=base $APP_PATH/build ./build
COPY --from=base $APP_PATH/server ./server
COPY --from=base $APP_PATH/public ./public
COPY --from=base $APP_PATH/.sequelizerc ./.sequelizerc
COPY --from=base $APP_PATH/node_modules ./node_modules
COPY --from=base $APP_PATH/package.json ./package.json
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001 && \
+18
View File
@@ -0,0 +1,18 @@
ARG APP_PATH=/opt/outline
FROM node:16.14.2-alpine3.15 AS deps
ARG APP_PATH
WORKDIR $APP_PATH
COPY ./package.json ./yarn.lock ./
RUN yarn install --no-optional --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
COPY . .
ARG CDN_URL
RUN yarn build
RUN rm -rf node_modules
RUN yarn install --production=true --frozen-lockfile --network-timeout 1000000 && \
yarn cache clean
+1 -1
View File
@@ -322,5 +322,5 @@
"dot-prop": "^5.2.0",
"js-yaml": "^3.14.1"
},
"version": "0.62.0"
"version": "0.63.0-0"
}