Use buildx functions for faster build (#20692)
* Use buildx functions for faster build * move link * cannot use --link with --chown
This commit is contained in:
parent
daf6f3453e
commit
92734e3df1
5
.github/workflows/build-image.yml
vendored
5
.github/workflows/build-image.yml
vendored
|
@ -40,7 +40,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
cache-from: type=registry,ref=tootsuite/mastodon:edge
|
cache-from: type=gha
|
||||||
cache-to: type=inline
|
cache-to: type=gha,mode=max
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
FROM ubuntu:20.04 as build-dep
|
FROM ubuntu:20.04 as build-dep
|
||||||
|
|
||||||
# Use bash for the shell
|
# Use bash for the shell
|
||||||
|
@ -65,8 +66,8 @@ RUN cd /opt/mastodon && \
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
# Copy over all the langs needed for runtime
|
# Copy over all the langs needed for runtime
|
||||||
COPY --from=build-dep /opt/node /opt/node
|
COPY --from=build-dep --link /opt/node /opt/node
|
||||||
COPY --from=build-dep /opt/ruby /opt/ruby
|
COPY --from=build-dep --link /opt/ruby /opt/ruby
|
||||||
|
|
||||||
# Add more PATHs to the PATH
|
# Add more PATHs to the PATH
|
||||||
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin"
|
ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin:/opt/mastodon/bin"
|
||||||
|
|
Loading…
Reference in a new issue