-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (53 loc) · 1.9 KB
/
Dockerfile
File metadata and controls
63 lines (53 loc) · 1.9 KB
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
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:24.04 AS ocre-ci
ARG USERNAME=ocre-dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG NODE_MAJOR=20
ARG WASI_SDK_VERSION=29
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
gpg \
make \
build-essential \
cmake \
cppcheck \
clang \
clang-format \
clang-tools \
libclang-rt-dev \
libclang-rt-dev-wasm32 \
lld \
llvm \
net-tools \
sudo \
jq \
yamllint \
python3-autopep8 \
markdownlint \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y --no-install-recommends \
nodejs \
&& apt-get clean -y\
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 50
# Install wasi-sysroot
RUN mkdir /opt/wasi-sysroot && \
curl -sSL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sysroot-$WASI_SDK_VERSION.0.tar.gz | \
tar zxvf - --strip-components=1 -C /opt/wasi-sysroot
FROM ocre-ci AS ocre-dev
# Accomodate the user for devcontainer
RUN (userdel -r $USERNAME ; userdel -r `id -nu $USER_UID` ; groupdel `id -ng $USER_GID`) || true \
&& groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
USER $USERNAME
WORKDIR /home/$USERNAME