forked from IBM/fhe-toolkit-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.FEDORA-s390x.Toolkit
69 lines (53 loc) · 2.44 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
ARG HElib_tag
FROM $HElib_tag
ENV container docker
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/v12.18.2/node-v12.18.2-linux-s390x.tar.xz | tar --no-same-owner -Jxf -
RUN cp -pr ./node-v12.18.2-linux-s390x/bin \
./node-v12.18.2-linux-s390x/include \
./node-v12.18.2-linux-s390x/lib \
./node-v12.18.2-linux-s390x/share \
/usr/local
# Install code-server so we can access vscode from a container context...
RUN curl -fsSL https://code-server.dev/install.sh | sh 2>&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/
# Install VSCode 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
# 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 VSCode user settings
RUN echo "{\"extensions.autoUpdate\": false}" > /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"]