aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile.dev
blob: 326f4676c09ec08841b88e0fab87dc47c31b9185 (plain)
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
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /hicn-build

COPY Makefile versions.cmake ./
COPY scripts scripts/

ARG USERNAME=ubuntu
ARG USER_UID=1000
ARG USER_GID=${USER_UID}

RUN apt update && apt-get install -y \
  make \
  sudo \
  curl \
  valgrind \
  git

RUN make deps debug-tools

# Add non-root user
RUN groupadd --gid ${USER_GID} ${USERNAME} && \
  useradd -s /bin/bash --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} && \
  echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL >/etc/sudoers.d/${USERNAME} && \
  chmod 0440 /etc/sudoers.d/${USERNAME}

USER ${USERNAME}
WORKDIR /home/${USERNAME}

ENV DEBIAN_FRONTEND=