Skip to content

Commit 2f919bf

Browse files
authored
Merge pull request #8 from wlisac/swift-5.1
Add Swift 5.1 Dockerfiles for armv6, armv7, and aarch64 devices
2 parents 37cbdd0 + 67661da commit 2f919bf

File tree

46 files changed

+2092
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2092
-22
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# wlisac/aarch64-ubuntu-swift:5.1-bionic-build
2+
3+
ARG BASE_IMAGE=balenalib/aarch64-ubuntu:bionic-build
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/aarch64-ubuntu:bionic as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/futurejones/swift-arm64/releases/download/v5.1-RELEASE/swift-5.1-aarch64-RELEASE-Ubuntu-18.04_2019-09-21.tar.gz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 18.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/18.04/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl4 \
34+
libxml2 \
35+
libedit2 \
36+
libsqlite3-0 \
37+
libc6-dev \
38+
binutils \
39+
libgcc-5-dev \
40+
libstdc++-5-dev \
41+
libpython2.7 \
42+
tzdata \
43+
git \
44+
pkg-config
45+
46+
# Copy files from downloader to root
47+
COPY --from=downloader /swift /
48+
49+
RUN swift --version
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# wlisac/aarch64-ubuntu-swift:5.1-bionic-run
2+
3+
ARG BASE_IMAGE=balenalib/aarch64-ubuntu:bionic-run
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/aarch64-ubuntu:bionic as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/futurejones/swift-arm64/releases/download/v5.1-RELEASE/swift-5.1-aarch64-RELEASE-Ubuntu-18.04_2019-09-21.tar.gz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 18.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/18.04/slim/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl4 \
34+
libxml2 \
35+
tzdata
36+
37+
# Copy files from downloader to root
38+
COPY --from=downloader /swift/usr/lib/swift/linux /usr/lib/swift/linux
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# wlisac/aarch64-ubuntu-swift:5.1-xenial-build
2+
3+
ARG BASE_IMAGE=balenalib/aarch64-ubuntu:xenial-build
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/aarch64-ubuntu:xenial as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/futurejones/swift-arm64/releases/download/v5.1-RELEASE/swift-5.1-aarch64-RELEASE-Ubuntu-16.04_2019-09-24.tar.gz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 16.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/16.04/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl3 \
34+
libxml2 \
35+
libedit2 \
36+
libsqlite3-0 \
37+
libc6-dev \
38+
binutils \
39+
libgcc-5-dev \
40+
libstdc++-5-dev \
41+
libpython2.7 \
42+
tzdata \
43+
git \
44+
pkg-config
45+
46+
# Copy files from downloader to root
47+
COPY --from=downloader /swift /
48+
49+
RUN swift --version
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# wlisac/aarch64-ubuntu-swift:5.1-xenial-run
2+
3+
ARG BASE_IMAGE=balenalib/aarch64-ubuntu:xenial-run
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/aarch64-ubuntu:xenial as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/futurejones/swift-arm64/releases/download/v5.1-RELEASE/swift-5.1-aarch64-RELEASE-Ubuntu-16.04_2019-09-24.tar.gz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 16.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/16.04/slim/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl3 \
34+
libxml2 \
35+
tzdata
36+
37+
# Copy files from downloader to root
38+
COPY --from=downloader /swift/usr/lib/swift/linux /usr/lib/swift/linux
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# wlisac/armv7hf-debian-swift:5.1-stretch-build
2+
3+
ARG BASE_IMAGE=balenalib/armv7hf-debian:stretch-build
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/armv7hf-debian:stretch as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.1/swift-5.1-armv7-DebianStretch.tgz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 16.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/16.04/Dockerfile
30+
31+
# Needed to add clang (not clang-3.8)
32+
# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies
33+
34+
# Also, I was getting "Unable to locate package libgcc-5-dev" and "Unable to locate package libstdc++-5-dev"
35+
# from the raw armv7hf base image.
36+
# I just removed these explicit dependencies since clang includes newer versions anyway.
37+
# https://forums.swift.org/t/which-clang-package-should-we-install/20542/7
38+
# Upgrading to libgcc-6-dev and libstdc++-6-dev explicitly would also be fine.
39+
40+
RUN install_packages \
41+
libatomic1 \
42+
libcurl3 \
43+
libxml2 \
44+
libedit2 \
45+
libsqlite3-0 \
46+
libc6-dev \
47+
binutils \
48+
libpython2.7 \
49+
tzdata \
50+
git \
51+
pkg-config \
52+
clang
53+
54+
# Copy files from downloader to root
55+
COPY --from=downloader /swift /
56+
57+
RUN swift --version
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# wlisac/armv7hf-debian-swift:5.1-stretch-run
2+
3+
ARG BASE_IMAGE=balenalib/armv7hf-debian:stretch-run
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/armv7hf-debian:stretch as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.1/swift-5.1-armv7-DebianStretch.tgz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 16.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/16.04/slim/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl3 \
34+
libxml2 \
35+
tzdata
36+
37+
# Copy files from downloader to root
38+
COPY --from=downloader /swift/usr/lib/swift/linux /usr/lib/swift/linux
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# wlisac/armv7hf-ubuntu-swift:5.1-bionic-build
2+
3+
ARG BASE_IMAGE=balenalib/armv7hf-ubuntu:bionic-build
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/armv7hf-ubuntu:bionic as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.1/swift-5.1-armv7-Ubuntu1804.tgz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 18.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/18.04/Dockerfile
30+
31+
# Needed to add clang
32+
# https://github.com/uraimo/buildSwiftOnARM/blob/1be3c13d709724b48b418c6511a38c8f323378ec/README.md#dependencies
33+
34+
RUN install_packages \
35+
libatomic1 \
36+
libcurl4 \
37+
libxml2 \
38+
libedit2 \
39+
libsqlite3-0 \
40+
libc6-dev \
41+
binutils \
42+
libgcc-5-dev \
43+
libstdc++-5-dev \
44+
libpython2.7 \
45+
tzdata \
46+
git \
47+
pkg-config \
48+
clang
49+
50+
# Copy files from downloader to root
51+
COPY --from=downloader /swift /
52+
53+
RUN swift --version
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# wlisac/armv7hf-ubuntu-swift:5.1-bionic-run
2+
3+
ARG BASE_IMAGE=balenalib/armv7hf-ubuntu:bionic-run
4+
5+
# Download and decompress the tarball into an intermediate container
6+
# to improve cache accross different base image variations
7+
8+
FROM balenalib/armv7hf-ubuntu:bionic as downloader
9+
10+
LABEL Description="Swift Downloader"
11+
12+
ARG TARBALL_URL=https://github.com/uraimo/buildSwiftOnARM/releases/download/5.1/swift-5.1-armv7-Ubuntu1804.tgz
13+
ARG TARBALL_FILE=swift.tgz
14+
15+
WORKDIR /swift
16+
17+
RUN curl -L -o $TARBALL_FILE $TARBALL_URL \
18+
&& tar -xvzf $TARBALL_FILE -C /swift \
19+
&& rm $TARBALL_FILE
20+
21+
# Create base image
22+
23+
FROM "$BASE_IMAGE"
24+
25+
LABEL maintainer "Will Lisac <will@lisac.org>"
26+
LABEL Description="Docker Container for Swift on Balena"
27+
28+
# Dependencies from official Swift Dockerfile for Swift 5.1 on Ubuntu 18.04
29+
# https://github.com/apple/swift-docker/blob/fd1691a1f73b68fb8c8ef6072e716892be54a3d2/5.1/ubuntu/18.04/slim/Dockerfile
30+
31+
RUN install_packages \
32+
libatomic1 \
33+
libcurl4 \
34+
libxml2 \
35+
tzdata
36+
37+
# Copy files from downloader to root
38+
COPY --from=downloader /swift/usr/lib/swift/linux /usr/lib/swift/linux

0 commit comments

Comments
 (0)