forked from RealDeviceMap/RealDeviceMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (59 loc) · 2.1 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# ================================
# Build image
# ================================
FROM swift:5.4-focal as build
WORKDIR /build
# Perfect-COpenSSL
RUN apt-get -y update && apt-get install -y libssl-dev
# Perfect-libcurl
RUN apt-get -y update && apt-get install -y libcurl4-openssl-dev
# Perfect-LinuxBridge
RUN apt-get -y update && apt-get install -y uuid-dev && rm -rf /var/lib/apt/lists/*
# ImageMagick for creating raid images
RUN apt-get -y update && apt-get install -y imagemagick && cp /usr/bin/convert /usr/local/bin
# WGet
RUN apt-get -y update && apt-get install -y wget
# MySQL Client
RUN apt-get -y update && \
apt-get install -y lsb-release mysql-client libmysqlclient-dev && \
sed -i -e 's/-fabi-version=2 -fno-omit-frame-pointer//g' /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc
# Pre-Build
COPY Package.swift Package.swift
COPY .emptysources Sources
COPY .emptytests Tests
RUN swift package update
RUN swift build -c release -Xswiftc -g
RUN rm -rf Sources
RUN rm -rf Tests
# Build with optimizations
COPY Sources Sources
COPY Tests Tests
RUN swift build -c release -Xswiftc -g
# ================================
# Run image
# ================================
FROM swift:5.4-focal
WORKDIR /app
# Perfect-COpenSSL
RUN apt-get -y update && apt-get install -y libssl-dev
# Perfect-libcurl
RUN apt-get -y update && apt-get install -y libcurl4-openssl-dev
# Perfect-LinuxBridge
RUN apt-get -y update && apt-get install -y uuid-dev && rm -rf /var/lib/apt/lists/*
# ImageMagick for creating raid images
RUN apt-get -y update && apt-get install -y imagemagick && cp /usr/bin/convert /usr/local/bin
# WGet
RUN apt-get -y update && apt-get install -y wget
# MySQL Client
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && \
apt-get install -y lsb-release mysql-client libmysqlclient-dev && \
sed -i -e 's/-fabi-version=2 -fno-omit-frame-pointer//g' /usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc
# Copy build artifacts
COPY --from=build /build/.build/release .
COPY resources resources
COPY Scripts Scripts
COPY .gitsha .
COPY .gitref .
RUN chmod +x ./Scripts/*
ENTRYPOINT ["./RealDeviceMapApp"]