fix docker tags, remove cargo-chef

This commit is contained in:
Felix Ableitner 2021-04-07 18:42:15 +02:00
parent 32ab9d5ddb
commit 6ca5f00214
2 changed files with 3 additions and 33 deletions

View File

@ -65,7 +65,7 @@ steps:
from_secret: docker_password
repo: dessalines/lemmy
tags:
- dev
- dev-linux-amd64
when:
branch:
- main
@ -184,7 +184,7 @@ steps:
from_secret: docker_password
repo: dessalines/lemmy
tags:
- dev
- dev-linux-arm64
when:
branch:
- main

View File

@ -1,38 +1,11 @@
ARG RUST_BUILDER_IMAGE=ekidd/rust-musl-builder:1.50.0
# Cargo chef plan
FROM $RUST_BUILDER_IMAGE as planner
WORKDIR /app
RUN cargo install cargo-chef
# Copy dirs
COPY ./ ./
RUN sudo chown -R rust:rust .
RUN cargo chef prepare --recipe-path recipe.json
# Cargo chef cache dependencies
FROM $RUST_BUILDER_IMAGE as cacher
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
WORKDIR /app
RUN cargo install cargo-chef
COPY --from=planner /app/recipe.json ./recipe.json
RUN sudo chown -R rust:rust .
RUN cargo chef cook --release --target ${CARGO_BUILD_TARGET} --recipe-path recipe.json
# Build the project
FROM $RUST_BUILDER_IMAGE as builder
FROM ekidd/rust-musl-builder:1.50.0 as builder
ARG CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
ARG RUSTRELEASEDIR="release"
WORKDIR /app
# Copy over the cached dependencies
COPY --from=cacher /app/target target
COPY --from=cacher /home/rust/.cargo /home/rust/.cargo
# Copy the rest of the dirs
COPY ./ ./
RUN sudo chown -R rust:rust .
@ -49,9 +22,6 @@ FROM alpine:3.12 as lemmy
# Install libpq for postgres
RUN apk add libpq
# Install Espeak for captchas
RUN apk add espeak
RUN addgroup -g 1000 lemmy
RUN adduser -D -s /bin/sh -u 1000 -G lemmy lemmy