-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 825 Bytes
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM debian:bullseye AS builder
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
clang \
make \
pkg-config \
libssl-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Makefile ./
COPY src/ ./src/
RUN clang \
-Wall -Wextra -std=c17 -g \
$(pkg-config --cflags openssl) \
-o mygit src/main.c \
$(pkg-config --libs openssl) -lz
# Final stage: a slimmer Debian image that only has runtime deps
FROM debian:bullseye-slim
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libssl1.1 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/mygit /usr/local/bin/mygit
ENTRYPOINT ["/usr/local/bin/mygit"]