This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathDockerfile.ALPINE-s390x.Toolkit
65 lines (48 loc) · 2.56 KB
/
Dockerfile.ALPINE-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
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 Alpine FHE IDE and Example Code Toolkit
# The code-server runs on HTTPS port 8443 so expose it
EXPOSE 8443/tcp
# Set root user for installation
USER root
WORKDIR /root
# Install pre-reqs for building code-server
RUN apk add --no-cache openssl python3 pkgconfig xterm libx11-dev libxkbfile-dev libsecret-dev
RUN apk add nodejs yarn
# Install code-server so we can access vscode from a container context...
RUN yarn global add node-gyp
RUN yarn global add node-pty
#RUN yarn global add code-server
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 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
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 VSCode user settings
RUN echo "{\"extensions.autoUpdate\": false}" > /opt/IBM/IDE-Data/User/settings.json
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"]