-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
79 lines (72 loc) · 2.01 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
79
FROM swift:5.10.1-jammy
# Install needed packages and setup non-root user.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY .devcontainer/library-scripts/common-debian.sh /tmp/library-scripts/
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && rm -rf /tmp/library-scripts
# Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="lts/*"
ENV NVM_DIR=/usr/local/share/nvm
ENV NVM_SYMLINK_CURRENT=true \
PATH=${NVM_DIR}/current/bin:${PATH}
COPY .devcontainer/library-scripts/node-debian.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
&& rm -rf /var/lib/apt/lists/* /tmp/library-scripts
# Install dependencies
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
apt-get -q update && \
apt-get -q install -y \
wget \
curl \
build-essential \
bash \
bc \
binutils \
bzip2 \
cpio \
g++ \
gcc \
git \
gzip \
libncurses5-dev \
make \
mercurial \
whois \
patch \
perl \
python3 \
rsync \
sed \
tar \
unzip \
cmake \
gnupg \
gnupg2 \
libc6-dev \
libcurl4-openssl-dev \
libedit2 \
libgcc-9-dev \
libpython3.8 \
libsqlite3-0 \
libstdc++-9-dev \
libxml2-dev \
libz3-dev \
pkg-config \
tzdata \
zlib1g-dev \
&& rm -r /var/lib/apt/lists/*
# Copy scripts
COPY . /usr/src/swift-armv7
# Set environment
ENV SRC_ROOT=/usr/src/swift-armv7
# Generate destination.json
RUN cd $SRC_ROOT && \
$SRC_ROOT/generate-swiftpm-toolchain.sh
# Fetch Debian 12 armhf sysroot and Swift runtime
RUN cd $SRC_ROOT && \
export DOWNLOAD_SWIFT_RUNTIME=1 && \
$SRC_ROOT/fetch-binaries.sh && \
rm -rf $SRC_ROOT/build/swift-armv7.tar.gz