Skip to content

Commit d058f0f

Browse files
authored
use official swift images (#60)
motivation: better alignment with community effort for swift docker changes: use the official swift docker images instead of custom ones
1 parent 9b1e9d3 commit d058f0f

File tree

2 files changed

+18
-46
lines changed

2 files changed

+18
-46
lines changed

docker/Dockerfile

+17-45
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,28 @@
1-
ARG ubuntu_version=18.04
2-
FROM ubuntu:$ubuntu_version
1+
ARG swift_version=5.0
2+
ARG ubuntu_version=bionic
3+
FROM swift:$swift_version-$ubuntu_version
34
# needed to do again after FROM due to docker limitation
5+
ARG swift_version
46
ARG ubuntu_version
57

6-
ARG DEBIAN_FRONTEND=noninteractive
7-
# do not start services during installation as this will fail and log a warning / error.
8-
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
8+
# set as UTF-8
9+
RUN apt-get update && apt-get install -y locales locales-all
10+
ENV LC_ALL en_US.UTF-8
11+
ENV LANG en_US.UTF-8
12+
ENV LANGUAGE en_US.UTF-8
913

10-
# basic dependencies
11-
RUN apt-get update && apt-get install -y wget git build-essential software-properties-common pkg-config locales
12-
RUN apt-get update && apt-get install -y libicu-dev libblocksruntime0 curl libcurl4-openssl-dev libz-dev
13-
14-
# local
15-
RUN locale-gen en_US.UTF-8
16-
RUN locale-gen en_US en_US.UTF-8
17-
RUN dpkg-reconfigure locales
18-
RUN echo 'export LANG=en_US.UTF-8' >> $HOME/.profile
19-
RUN echo 'export LANGUAGE=en_US:en' >> $HOME/.profile
20-
RUN echo 'export LC_ALL=en_US.UTF-8' >> $HOME/.profile
21-
22-
# known_hosts
23-
RUN mkdir -p $HOME/.ssh
24-
RUN touch $HOME/.ssh/known_hosts
25-
RUN ssh-keyscan github.com 2> /dev/null >> $HOME/.ssh/known_hosts
26-
27-
# clang
28-
RUN apt-get update && apt-get install -y clang-3.9
29-
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.9 100
30-
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.9 100
14+
# dependencies
15+
RUN apt-get update && apt-get install -y wget
16+
RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools # used by integration tests
3117

3218
# ruby and jazzy for docs generation
33-
#ARG skip_ruby_from_ppa
34-
#RUN [ -n "$skip_ruby_from_ppa" ] || apt-add-repository -y ppa:brightbox/ruby-ng
35-
#RUN [ -n "$skip_ruby_from_ppa" ] || { apt-get update && apt-get install -y ruby2.4 ruby2.4-dev; }
36-
#RUN [ -z "$skip_ruby_from_ppa" ] || { apt-get update && apt-get install -y ruby ruby-dev; }
37-
#RUN apt-get update && apt-get install -y libsqlite3-dev
3819
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev
3920
RUN gem install jazzy --no-ri --no-rdoc
4021

41-
# swift
42-
ARG swift_version=4.2.3
43-
ARG swift_flavour=RELEASE
44-
ARG swift_builds_suffix=release
45-
46-
RUN mkdir $HOME/.swift
47-
RUN wget -q "https://swift.org/builds/swift-${swift_version}-${swift_builds_suffix}/ubuntu$(echo $ubuntu_version | sed 's/\.//g')/swift-${swift_version}-${swift_flavour}/swift-${swift_version}-${swift_flavour}-ubuntu${ubuntu_version}.tar.gz" -O $HOME/swift.tar.gz
48-
RUN tar xzf $HOME/swift.tar.gz --directory $HOME/.swift --strip-components=1
49-
RUN echo 'export PATH="$HOME/.swift/usr/bin:$PATH"' >> $HOME/.profile
50-
RUN echo 'export LINUX_SOURCEKIT_LIB_PATH="$HOME/.swift/usr/lib"' >> $HOME/.profile
22+
# tools
23+
RUN mkdir -p $HOME/.tools
24+
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile
5125

5226
# script to allow mapping framepointers on linux
53-
RUN mkdir -p $HOME/.scripts
54-
RUN wget -q https://raw.githubusercontent.com/apple/swift/master/utils/symbolicate-linux-fatal -O $HOME/.scripts/symbolicate-linux-fatal
55-
RUN chmod 755 $HOME/.scripts/symbolicate-linux-fatal
56-
RUN echo 'export PATH="$HOME/.scripts:$PATH"' >> $HOME/.profile
27+
RUN wget -q https://raw.githubusercontent.com/apple/swift/master/utils/symbolicate-linux-fatal -O $HOME/.tools/symbolicate-linux-fatal
28+
RUN chmod 755 $HOME/.tools/symbolicate-linux-fatal

docker/docker-compose.1804.50.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
image: async-http-client:18.04-5.0
77
build:
88
args:
9-
ubuntu_version: "18.04"
9+
ubuntu_version: "bionic"
1010
swift_version: "5.0"
1111

1212
test:

0 commit comments

Comments
 (0)