Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Till0196 committed Jan 18, 2025
1 parent 93316bd commit 7021b51
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/build-sharelatex-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,42 @@ jobs:
- name: sharelatex base image build (arm64 only)
if: ${{ matrix.platform == 'linux/arm64' }}
run: |
git clone https://github.com/overleaf/overleaf --depth 1 --recursive
docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--progress=plain \
--file overleaf/server-ce/Dockerfile-base \
--pull \
--tag sharelatex/sharelatex-base:latest \
overleaf
docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--progress=plain \
--file overleaf/server-ce/Dockerfile \
--tag sharelatex:latest \
overleaf
git clone https://github.com/overleaf/overleaf --depth 1 --recursive sharelatex/overleaf
- name: sharelatex-base Build and push (arm64 only)
if: ${{ matrix.platform == 'linux/arm64' }}
uses: docker/build-push-action@v5
with:
context: ./sharelatex/overleaf
file: sharelatex/overleaf/server-ce/Dockerfile-base
push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }}-base,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: sharelatex Build and push (arm64 only)
if: ${{ matrix.platform == 'linux/arm64' }}
uses: docker/build-push-action@v5
with:
context: ./sharelatex/overleaf
file: sharelatex/overleaf/server-ce/Dockerfile
build-args: |
OVERLEAF_BASE_TAG=${{ env.REGISTRY_IMAGE }}-base:latest
push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=${{ env.REGISTRY_IMAGE }}-arm64,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
context: ./sharelatex
file: sharelatex/Dockerfile
load: true
push: true
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
2 changes: 1 addition & 1 deletion sharelatex/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG TARGETARCH
FROM sharelatex/sharelatex:5 AS base-amd64

# arm64の場合、DockerHubにarm64向けイメージが存在しないため事前にビルドしたベースイメージを利用
FROM sharelatex:latest AS base-arm64
FROM ghcr.io/till0196/sharelatex-arm64:latest AS base-arm64

# アーキテクチャに応じてベースイメージを選択
FROM base-${TARGETARCH}
Expand Down

0 comments on commit 7021b51

Please sign in to comment.