Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
Emelie Graven | f9d6b40fd2 | ||
Emelie Graven | 3938c58b60 | ||
Emelie Graven | 76919e67f3 | ||
Emelie Graven | 5a95ec4586 |
18
.drone.yml
Normal file
18
.drone.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: egraven/zola
|
||||||
|
username: egraven
|
||||||
|
password:
|
||||||
|
from_secret: DOCKER_TOKEN
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- "${DRONE_SEMVER}"
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- release
|
35
Dockerfile
35
Dockerfile
|
@ -1,21 +1,28 @@
|
||||||
FROM rust:slim AS builder
|
FROM lukemathwalker/cargo-chef:latest-rust-slim AS chef
|
||||||
|
WORKDIR zola
|
||||||
|
|
||||||
RUN apt-get update -y && \
|
FROM chef AS deps
|
||||||
apt-get install -y python-pip make g++ python-setuptools libssl-dev pkg-config rsync && \
|
#RUN rustup target add x86_64-unknown-linux-musl
|
||||||
pip install dockerize && \
|
RUN apt-get update && apt-get install -y make g++ pkg-config libssl-dev # musl-tools
|
||||||
rustup target add x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
WORKDIR /app
|
FROM deps AS recipe
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
RUN cargo build --release --target x86_64-unknown-linux-gnu
|
FROM deps AS build
|
||||||
|
COPY --from=recipe /zola/recipe.json recipe.json
|
||||||
|
#RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
|
||||||
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
RUN mv target/x86_64-unknown-linux-gnu/release/zola /usr/bin
|
COPY . .
|
||||||
RUN mkdir -p /workdir
|
#RUN cargo build --release --target x86_64-unknown-linux-musl --bin zola
|
||||||
WORKDIR /workdir
|
RUN cargo build --release --bin zola
|
||||||
RUN dockerize -n -o /workdir /usr/bin/zola
|
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim AS runtime
|
||||||
|
WORKDIR zola
|
||||||
|
#COPY --from=build zola/target/x86_64-unknown-linux-musl/release/zola /usr/local/bin/
|
||||||
|
COPY --from=build zola/target/release/zola /usr/local/bin/
|
||||||
|
ENTRYPOINT ["/usr/local/bin/zola"]
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.authors="Emelie Graven <emelie@graven.dev>"
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
COPY --from=builder /workdir .
|
|
||||||
ENTRYPOINT [ "/usr/bin/zola" ]
|
|
||||||
|
|
Loading…
Reference in a new issue