forked from krzysztofzablocki/Sourcery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (40 loc) · 1.2 KB
/
Dockerfile
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
35
36
37
38
39
40
41
42
43
44
45
ARG BUILDER_IMAGE=swift:5.9-jammy
ARG RUNTIME_IMAGE=swift:5.9-jammy-slim
# Builder image
FROM ${BUILDER_IMAGE} AS builder
RUN apt-get update && apt-get install -y \
build-essential \
libffi-dev \
libncurses5-dev \
libsqlite3-dev \
&& rm -r /var/lib/apt/lists/*
WORKDIR /workdir/
COPY Sourcery Sourcery/
COPY SourceryExecutable SourceryExecutable/
COPY SourceryFramework SourceryFramework/
COPY SourceryJS SourceryJS/
COPY SourceryRuntime SourceryRuntime/
COPY SourceryStencil SourceryStencil/
COPY SourcerySwift SourcerySwift/
COPY SourceryTests SourceryTests/
COPY SourceryUtils SourceryUtils/
COPY Plugins Plugins/
COPY Templates Templates/
COPY Tests Tests/
COPY Package.* ./
RUN swift package update
ARG SWIFT_FLAGS="-c release"
RUN swift build $SWIFT_FLAGS --product sourcery
RUN mv `swift build $SWIFT_FLAGS --show-bin-path`/sourcery /usr/bin
RUN sourcery --version
# Runtime image
FROM ${RUNTIME_IMAGE}
LABEL org.opencontainers.image.source https://github.com/krzysztofzablocki/Sourcery
RUN apt-get update && apt-get install -y \
libcurl4 \
libsqlite3-0 \
libxml2 \
&& rm -r /var/lib/apt/lists/*
COPY --from=builder /usr/bin/sourcery /usr/bin
RUN sourcery --version
CMD ["sourcery"]