-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile.toolkit
50 lines (38 loc) · 1.31 KB
/
Dockerfile.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
# Copyright (C) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Username
ARG TOOLKIT_BASE_IMAGE
FROM $TOOLKIT_BASE_IMAGE
LABEL maintainer="HE Toolkit github.com/intel/he-toolkit"
# User-setup
ARG UNAME
ARG UID
ARG GID
ARG HOME="/home/$UNAME"
ENV SHELL="/bin/bash"
RUN groupadd -g $GID $UNAME && \
useradd --no-log-init -m -u $UID -g $GID -s /bin/bash $UNAME && \
echo "$UNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# ADD copies and untars for us
ADD toolkit.tar.gz $HOME/he-toolkit
RUN chown -R $UNAME:$UNAME $HOME/he-toolkit
# Switch user to $UNAME
USER $UNAME
###################################################
# CVE-2023-5752
# Install upstream pip (version >=23.3.1) as user
RUN mkdir -p $HOME/pip-install-package \
$HOME/.local/bin \
$HOME/.local/lib
WORKDIR $HOME/pip-install-package
RUN wget https://bootstrap.pypa.io/get-pip.py && \
python get-pip.py && \
. $HOME/.profile && \
pip install pip --upgrade
###################################################
RUN ["pip", "install", "toml", "argcomplete"]
# Change directories to $HOME/Intel-HE-Toolkit
WORKDIR $HOME/he-toolkit
# Initialize hekit and install librares, examples, and kernels
RUN echo "y" | ./hekit init --default-config
ENTRYPOINT . docker/runners.sh && welcome_message && cd $HOME && /bin/bash