forked from IBM/fhe-toolkit-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.FEDORA-s390x.Toolkit
76 lines (60 loc) · 2.89 KB
/
Dockerfile.FEDORA-s390x.Toolkit
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
ARG HElib_tag
FROM $HElib_tag
ARG HElib_cmake_lists_version
ENV container docker
ENV HELIB_CMAKE_LISTS_VERSON=$HElib_cmake_lists_version
LABEL maintainer="Flavio Bergamaschi <[email protected]>"
# Docker Container for Ubuntu FHE IDE and Example Code Toolkit
# The vscode server runs on HTTPS port 443 so expose it
EXPOSE 8443/tcp
# Set root user for installation
USER root
WORKDIR /root
# Install pre-reqs for building code-server
RUN yum -y install \
python \
python3 \
pkg-config \
xterm \
libX11-devel \
libxkbfile-devel \
libsecret-devel
RUN yum clean packages
# Istall Node.js v12+
RUN curl -fsSL https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-s390x.tar.xz | tar --no-same-owner -Jxf -
RUN cp -pr ./node-v14.17.3-linux-s390x/bin \
./node-v14.17.3-linux-s390x/include \
./node-v14.17.3-linux-s390x/lib \
./node-v14.17.3-linux-s390x/share \
/usr/local
RUN npm install --global yarn
# Install code-server so we can access vscode from a container context...
#RUN curl -fsSL https://code-server.dev/install.sh | sh 2>&1
RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 3.9.1
# Create a directory to hold the VSCode user data when running as root
RUN mkdir -p /opt/IBM/IDE-Data
RUN chown -R fhe:fhe /opt/IBM/IDE-Data
# Create a directory to hold the user FHE workspace to contain project/sample code
RUN mkdir -p /opt/IBM/FHE-Workspace
RUN chown -R fhe:fhe /opt/IBM/FHE-Workspace
# Set fhe user for the remaining of the installation
USER fhe
WORKDIR /home/fhe
RUN mkdir /opt/IBM/FHE-Workspace/.vscode
COPY --chown=fhe:fhe ./IDE_Config /opt/IBM/FHE-Workspace/.vscode
RUN mkdir -p /opt/IBM/FHE-Workspace/examples
RUN cp -rp /opt/IBM/FHE-distro/HElib/examples /opt/IBM/FHE-Workspace
# Copy over additional examples into the FHE-Workspace from the github checkout on this host
COPY --chown=fhe:fhe ./samples/ /opt/IBM/FHE-Workspace/examples/
ENV HELAYERS_DATA_SETS_DIR="/opt/IBM/FHE-Workspace/examples/data/"
ENV HELAYERS_EXAMPLES_DIR="/opt/IBM/FHE-Workspace/examples/"
# Install code-server extensions
#RUN code-server --user-data-dir=/opt/IBM/IDE-Data/ --install-extension ms-vscode.cpptools --force
RUN code-server --user-data-dir=/opt/IBM/IDE-Data/ --install-extension ms-vscode.cmake-tools --force
RUN code-server --user-data-dir=/opt/IBM/IDE-Data/ --install-extension twxs.cmake --force
# set code-server to create a self signed cert
RUN sed -i.bak 's/cert: false/cert: true/' /home/fhe/.config/code-server/config.yaml
# Update code-server user settings
RUN echo "{\"extensions.autoUpdate\": false,\n\"workbench.colorTheme\": \"Dark\"}" > /opt/IBM/IDE-Data/User/settings.json
# Set the default command to launch the VS Project as a web application
CMD ["code-server", "--bind-addr", "0.0.0.0:8443", "--user-data-dir", "/opt/IBM/IDE-Data/", "/opt/IBM/FHE-Workspace", "--auth", "none", "--disable-telemetry"]