mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 04:11:17 +00:00
Check dockerfile during CI, ignore error
This commit is contained in:
parent
a9d6d4e6e0
commit
71fc34605e
2 changed files with 9 additions and 14 deletions
|
@ -147,6 +147,11 @@ steps:
|
||||||
- cargo clippy --workspace --tests --all-targets -- -D warnings
|
- cargo clippy --workspace --tests --all-targets -- -D warnings
|
||||||
when: *slow_check_paths
|
when: *slow_check_paths
|
||||||
|
|
||||||
|
docker_check:
|
||||||
|
image: docker/dockerfile:1.11
|
||||||
|
commands:
|
||||||
|
- docker build --check . -f docker/Dockerfile
|
||||||
|
|
||||||
cargo_build:
|
cargo_build:
|
||||||
image: *rust_image
|
image: *rust_image
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1.10
|
# syntax=docker/dockerfile:1.9
|
||||||
ARG RUST_VERSION=1.81
|
# check=skip=FromPlatformFlagConstDisallowed
|
||||||
|
ARG RUST_VERSION=1.80
|
||||||
ARG CARGO_BUILD_FEATURES=default
|
ARG CARGO_BUILD_FEATURES=default
|
||||||
ARG RUST_RELEASE_MODE=debug
|
ARG RUST_RELEASE_MODE=debug
|
||||||
|
|
||||||
|
@ -38,12 +39,6 @@ RUN --mount=type=cache,target=/lemmy/target set -ex; \
|
||||||
cargo clean --release; \
|
cargo clean --release; \
|
||||||
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
|
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
|
||||||
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
|
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
|
||||||
#
|
|
||||||
# Compress the binary with upx
|
|
||||||
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz; \
|
|
||||||
tar -xvf upx-4.2.4-amd64_linux.tar.xz; \
|
|
||||||
cp upx-4.2.4-amd64_linux/upx /usr/bin; \
|
|
||||||
upx --best --lzma lemmy_server; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ARM64 builder
|
# ARM64 builder
|
||||||
|
@ -77,14 +72,9 @@ RUN --mount=type=cache,target=./target,uid=10001,gid=10001 set -ex; \
|
||||||
cargo clean --release; \
|
cargo clean --release; \
|
||||||
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
|
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
|
||||||
mv "./target/$CARGO_BUILD_TARGET/$RUST_RELEASE_MODE/lemmy_server" /home/lemmy/lemmy_server; \
|
mv "./target/$CARGO_BUILD_TARGET/$RUST_RELEASE_MODE/lemmy_server" /home/lemmy/lemmy_server; \
|
||||||
#
|
|
||||||
# Compress the binary with upx
|
|
||||||
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-arm64_linux.tar.xz; \
|
|
||||||
tar -xvf upx-4.2.4-arm64_linux.tar.xz; \
|
|
||||||
cp upx-4.2.4-arm64_linux/upx /usr/bin; \
|
|
||||||
upx --best --lzma /home/lemmy/lemmy_server; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# amd64 base runner
|
# amd64 base runner
|
||||||
FROM ${AMD_RUNNER_IMAGE} AS runner-linux-amd64
|
FROM ${AMD_RUNNER_IMAGE} AS runner-linux-amd64
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue