Skip to content

Commit 0592376

Browse files
committed
musl docker #618
1 parent 25f8276 commit 0592376

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
target
2-
Dockerfile
2+
dockerfile
33
.dockerignore
44
.env
55
.git

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141
images: joepmeneer/atomic-server
4242
github-token: ${{ secrets.GITHUB_TOKEN }}
4343
tags: |
44+
# set latest tag for master branch
45+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
4446
type=schedule
4547
type=ref,event=branch
4648
type=ref,event=pr

dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
FROM rust:1.67 as builder
1+
FROM rust:1.67 AS builder
2+
# Install musl dependencies
3+
RUN rustup target add x86_64-unknown-linux-musl
4+
RUN apt update && apt install -y musl-tools musl-dev
25
WORKDIR /app
36
COPY . .
4-
RUN cargo build --release --bin atomic-server --config net.git-fetch-with-cli=true
7+
RUN cargo build --release --bin atomic-server --config net.git-fetch-with-cli=true --target x86_64-unknown-linux-musl
8+
RUN strip -s /app/target/x86_64-unknown-linux-musl/release/atomic-server
9+
10+
FROM scratch as runtime
11+
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/atomic-server /atomic-server-bin
512

6-
# We only need a small runtime for this step, but make sure glibc is installed
7-
FROM frolvlad/alpine-glibc:alpine-3.16_glibc-2.34 as runtime
8-
COPY --chmod=0755 --from=builder /app/target/release/atomic-server /atomic-server-bin
913
# For a complete list of possible ENV vars or available flags, run with `--help`
1014
ENV ATOMIC_STORE_PATH="/atomic-storage/db"
1115
ENV ATOMIC_CONFIG_PATH="/atomic-storage/config.toml"

0 commit comments

Comments
 (0)