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 160
/
Dockerfile.UBUNTU-amd64.Toolkit
63 lines (48 loc) · 2.84 KB
/
Dockerfile.UBUNTU-amd64.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
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 code-server runs on HTTPS port 8443 so expose it
EXPOSE 8443/tcp
# Set root user for installation
USER root
WORKDIR /root
# Set noninteractive installation
RUN export DEBIAN_FRONTEND=noninteractive
# Install code-server so we can access the IDE from a container context...
#RUN curl -fsSL https://code-server.dev/install.sh | sh
RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 3.9.1
#Install cpptools from the latest vsix version which we are pinning to because we have issues getting it to install normally - 12.03.2020 - greg
#Previously this was version 1.1.2 and we update to 1.4.0 - 06.02.2021 - greg
ADD https://github.com/microsoft/vscode-cpptools/releases/download/1.4.0/cpptools-linux.vsix /opt/IBM/FHE-Workspace/
# Create a directory to hold the VSCode user data
RUN mkdir -p /opt/IBM/IDE-Data
RUN chown -R fhe:fhe /opt/IBM/IDE-Data
# Create a directory to hold the user's 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 /opt/IBM/FHE-Workspace/cpptools-linux.vsix --force; exit 0
#RUN code-server --user-data-dir=/opt/IBM/IDE-Data/ --install-extension /opt/IBM/FHE-Workspace/cpptools.vsix --force; exit 0
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 code-server 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"]