mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Copy built files directly from builder image
This commit is contained in:
parent
8f8f455bea
commit
cc46934d38
6
.github/workflows/Dockerfile.copyin
vendored
6
.github/workflows/Dockerfile.copyin
vendored
|
|
@ -1,10 +1,12 @@
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
|
ARG BUILDER=
|
||||||
|
ARG BUILDER_TAG=
|
||||||
ARG DENDRITE_BINARY=
|
ARG DENDRITE_BINARY=
|
||||||
ARG BIN_DIRECTORY=
|
|
||||||
ENV DENDRITE_BINARY=${DENDRITE_BINARY}
|
ENV DENDRITE_BINARY=${DENDRITE_BINARY}
|
||||||
|
|
||||||
COPY --from=builder /build/bin/* /usr/bin
|
COPY --from=${BUILDER}:${BUILDER_TAG} /build/bin/* /usr/bin
|
||||||
|
|
||||||
VOLUME /etc/dendrite
|
VOLUME /etc/dendrite
|
||||||
WORKDIR /etc/dendrite
|
WORKDIR /etc/dendrite
|
||||||
|
|
|
||||||
46
.github/workflows/cross-compiling-docker.yml
vendored
46
.github/workflows/cross-compiling-docker.yml
vendored
|
|
@ -5,57 +5,41 @@ on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile:
|
compile:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target: [amd64, arm64, arm]
|
target: [amd64, arm64, arm]
|
||||||
env:
|
env:
|
||||||
GOARCH: ${{ matrix.target }}
|
GOARCH: ${{ matrix.target }}
|
||||||
IMAGE_NAME: "dendrite-builder"
|
BUILDER_IMAGE_NAME: "dendrite-builder"
|
||||||
runs-on: ubuntu-latest
|
DOCKER_HUB_USER: dendritegithub
|
||||||
|
services:
|
||||||
|
registry:
|
||||||
|
image: registry:2
|
||||||
|
ports:
|
||||||
|
- 5000:5000
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: docker/setup-buildx-action@v1
|
- uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
driver-opts: network=host
|
||||||
- name: build dendrite in Docker
|
- name: build dendrite in Docker
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./.github/workflows/Dockerfile.builder
|
file: ./.github/workflows/Dockerfile.builder
|
||||||
load: true # load into local image store
|
load: true # load into local image store
|
||||||
tags: "${{ env.IMAGE_NAME }}:${{ matrix.target }}"
|
tags: "${{ env.BUILDER_IMAGE_NAME }}:${{ matrix.target }}"
|
||||||
- name: copy built files out of docker
|
build-args: "GOARCH=${{ env.GOARCH }}"
|
||||||
run: docker run -v "$(pwd)/bin:/build/bin-out" "${{ env.IMAGE_NAME }}:${{ matrix.target }}" "/bin/sh" "-c" "cp -a /build/bin/* /build/bin-out"
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: bin-${{ matrix.target }}
|
|
||||||
path: ./bin
|
|
||||||
build-monolith:
|
|
||||||
needs: [compile]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
registry:
|
|
||||||
image: registry:2
|
|
||||||
ports:
|
|
||||||
- 5000:5000
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target: [amd64, arm64, arm]
|
|
||||||
env:
|
|
||||||
DOCKER_HUB_USER: dendritegithub
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: bin-${{ matrix.target }}
|
|
||||||
# - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
# - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
- run: echo "DOCKER_TARGET=$(./.github/workflows/get-compiler.sh docker)" >> $GITHUB_ENV
|
- run: echo "DOCKER_TARGET=$(./.github/workflows/get-compiler.sh docker)" >> $GITHUB_ENV
|
||||||
- uses: docker/setup-qemu-action@v1
|
- uses: docker/setup-qemu-action@v1
|
||||||
- uses: docker/setup-buildx-action@v1
|
- name: build monolith
|
||||||
with:
|
uses: docker/build-push-action@v2
|
||||||
driver-opts: network=host
|
|
||||||
- uses: docker/build-push-action@v2
|
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./.github/workflows/Dockerfile.copyin
|
file: ./.github/workflows/Dockerfile.copyin
|
||||||
platforms: ${{ env.DOCKER_TARGET }}
|
platforms: ${{ env.DOCKER_TARGET }}
|
||||||
push: true
|
push: true
|
||||||
tags: localhost:5000/matrixdotorg/dendrite-monolith:latest
|
tags: localhost:5000/matrixdotorg/dendrite-monolith:latest
|
||||||
|
build-args: "BUILDER=${{ env.BUILDER_IMAGE_NAME }}\nBUILDER_TAG=${{ env.GOARCH }}\nDENDRITE_BINARY=dendrite-monolith-server"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue