Files
concrete/docker/Dockerfile.concrete-framework-dev
Arthur Meyre e522f22ce8 chore: rename package
- poetry lock required to update package name
- related Makefile and licenses update to keep consistency (will be removed
once the PyPi package is available)
- modified compile_torch_model to only accept datasets with one input
mypy error with better numpy typing hints appeared

closes #1252
2022-01-04 09:12:18 +01:00

44 lines
1.5 KiB
Docker

FROM ghcr.io/zama-ai/concrete-framework-env
ENV SRC_DIR=/src
# Default to Ubuntu default uid for first user
ARG BUILD_GID=1000
ARG BUILD_UID=1000
# Get sudo for our future user
RUN apt-get update && \
apt-get install --no-install-recommends -y sudo && \
rm -rf /var/lib/apt/lists/*
# From https://dev.to/emmanuelnk/using-sudo-without-password-prompt-as-non-root-docker-user-52bg
# Create dev_user and add it to relevant groups
# Create /src and make the dev user own it
# Ensure sudo group users are not asked for a password when using
# sudo command by ammending sudoers file
RUN groupadd -g "${BUILD_GID}" dev_user && \
adduser --disabled-password \
--uid "${BUILD_UID}" --gid "${BUILD_GID}" --shell /bin/bash --gecos "" dev_user && \
usermod -aG sudo dev_user && \
mkdir -p "${SRC_DIR}" && \
chown dev_user "${SRC_DIR}" && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Now switch to the newly created user
USER dev_user
RUN echo "source ~/dev_venv/bin/activate" >> ~/.bashrc && \
echo "if [[ \"\$?\" != \"0\" ]]; then" >> ~/.bashrc && \
echo " python3 -m venv ~/dev_venv" >> ~/.bashrc && \
echo " source ~/dev_venv/bin/activate" >> ~/.bashrc && \
echo " cd ${SRC_DIR}/ && make setup_env" >> ~/.bashrc && \
echo "fi" >> ~/.bashrc && \
echo "export MPLBACKEND=TkAgg" >> ~/.bashrc && \
touch ~/.sudo_as_admin_successful && \
mkdir -p ~/dev_venv && \
mkdir -p ~/.cache
WORKDIR ${SRC_DIR}
CMD ["/bin/bash"]