-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathDockerfile
77 lines (63 loc) · 3.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
ARG EMSCRIPTEN_VERSION=1.38.33
FROM trzeci/emscripten:sdk-tag-${EMSCRIPTEN_VERSION}-64bit as emscripten_base
# ------------------------------------------------------------------------------
# Entries in this section is required to move Emscripten SDK to another base image
# Any arbitrary base image of choice
FROM ubuntu:bionic
# Source /emsdk_portable contains every emscripten tool.
# It's not recommended to change destination path
COPY --from=emscripten_base /emsdk_portable /emsdk_portable
# Fallback in case Emscripten isn't activated.
# This will let use tools offered by this image inside other Docker images (sub-stages) or with custom / no entrypoint
ENV EMSDK /emsdk_portable
ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk
ENV EM_DATA ${EMSDK}/.data
ENV EM_CONFIG ${EMSDK}/.emscripten
ENV EM_CACHE ${EM_DATA}/cache
ENV EM_PORTS ${EM_DATA}/ports
# Fallback in case Emscripten isn't activated
# Expose Major tools to system PATH, so that emcc, node, asm2wasm etc can be used without activation
ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"
# Use entrypoint that's coming from emscripten-slim image. It sets all required system paths and variables
ENTRYPOINT ["/emsdk_portable/entrypoint"]
# ------------------------------------------------------------------------------
# This section contain an arbitrary code for image customization
RUN echo "Start emscripten-ubuntu compilation" \
&& echo "## Create a standard user: emscripten:emscripten" \
&& groupadd --gid 1000 emscripten \
&& useradd --uid 1000 --gid emscripten --shell /bin/bash --create-home emscripten \
\
&& echo "## Update and install packages" \
&& apt-get -qq -y update && apt-get -qq install -y --no-install-recommends \
wget \
git-core \
ca-certificates \
build-essential \
python \
python-pip \
python3 \
python3-pip \
wget \
curl \
zip \
unzip \
git \
ssh-client \
ca-certificates \
build-essential \
make \
cmake \
ant \
&& echo "\n## Done"
# ------------------------------------------------------------------------------
WORKDIR /src
# ------------------------------------------------------------------------------
# Copy this Dockerimage into image, so that it will be possible to recreate it later
COPY Dockerfile /emsdk_portable/dockerfiles/trzeci/emscripten-ubuntu/
LABEL maintainer="kontakt@trzeci.eu" \
org.label-schema.name="emscripten-ubuntu" \
org.label-schema.description="Regular version of Emscripten compiler what should be suitable to compile majority of C++ projects for Emscripten, ASM.js and WebAssembly." \
org.label-schema.url="https://trzeci.eu" \
org.label-schema.vcs-url="https://github.com/trzecieu/emscripten-docker" \
org.label-schema.docker.dockerfile="/docker/trzeci/emscripten-ubuntu/Dockerfile"
# ------------------------------------------------------------------------------