forked from swiftwasm/carton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.3 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
FROM ghcr.io/swiftwasm/swift:5.7-focal
LABEL maintainer="SwiftWasm Maintainers <[email protected]>"
LABEL Description="Carton is a watcher, bundler, and test runner for your SwiftWasm apps"
LABEL org.opencontainers.image.source https://github.com/swiftwasm/carton
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
apt-get -q install -y \
build-essential \
libncurses5 \
libsqlite3-0 \
libsqlite3-dev \
libxkbcommon0 \
curl unzip \
&& export WASMER_DIR=/usr/local && curl https://get.wasmer.io -sSfL | sh -s "2.2.1" && \
rm -r /var/lib/apt/lists/*
ENV CARTON_ROOT=/root/.carton
ENV CARTON_DEFAULT_TOOLCHAIN=wasm-5.7.1-RELEASE
RUN mkdir -p $CARTON_ROOT/sdk && \
mkdir -p $CARTON_ROOT/sdk/$CARTON_DEFAULT_TOOLCHAIN && \
ln -s /usr $CARTON_ROOT/sdk/$CARTON_DEFAULT_TOOLCHAIN/usr
COPY . carton/
ENV NODE_VERSION=18.1.0
RUN curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" && \
tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner
RUN cd carton && \
./install_ubuntu_deps.sh && \
swift build -c release && \
mv .build/release/carton /usr/bin && \
cd .. && \
rm -rf carton /tmp/wasmer*
# Set the default command to run
CMD ["carton --help"]