Skip to content

Commit c613077

Browse files
authored
Docker Setup (#2)
* Doc: Added a proposal for swift-etcd-client API * Update 0001-swift-etcd-api.md: made the doc for get function * updated key-val operation * feat: added docke-compose and dockerfile * feat: added docke-compose and dockerfile * fix: update dockerfile
1 parent 55a6e8e commit c613077

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

DOCKERFILE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG swift_version=5.10
2+
ARG ubuntu_version=jammy
3+
ARG base_image=swift:$swift_version-$ubuntu_version
4+
FROM $base_image
5+
# needed to do again after FROM due to docker limitation
6+
ARG swift_version
7+
ARG ubuntu_version
8+
9+
# set as UTF-8
10+
RUN apt-get update && apt-get install -y locales locales-all
11+
ENV LC_ALL en_US.UTF-8
12+
ENV LANG en_US.UTF-8
13+
ENV LANGUAGE en_US.UTF-8
14+
15+
# tools
16+
RUN mkdir -p $HOME/.tools
17+
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile
18+
19+
# swiftformat (until part of the toolchain)
20+
ARG swiftformat_version=0.51.8
21+
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/nicklockwood/SwiftFormat $HOME/.tools/swift-format
22+
RUN cd $HOME/.tools/swift-format && swift build -c release
23+
RUN ln -s $HOME/.tools/swift-format/.build/release/swiftformat $HOME/.tools/swiftformat
24+
25+
# install jemalloc for running allocation benchmarks
26+
RUN apt-get update & apt-get install -y libjemalloc-dev

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: '3.9'
2+
services:
3+
etcd:
4+
ports:
5+
- "2379:2379"
6+
image: quay.io/coreos/etcd:v3.5.6
7+
command: etcd --initial-cluster-state new --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://127.0.0.1:2379

0 commit comments

Comments
 (0)