-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
42 lines (32 loc) · 1006 Bytes
/
Dockerfile
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
# Use ubuntu for the base image
FROM ubuntu:22.04
# Install necessary packages
RUN apt-get update && apt-get install -y \
bash \
git \
make \
g++ \
wget \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m milkv && echo "milkv:milkv" | chpasswd && adduser milkv sudo
# Switch to the new user
USER milkv
SHELL ["/bin/bash", "-c"]
# Set the working directory
WORKDIR /home/milkv
# Clone the repository and source the setup script
RUN git clone https://github.com/milkv-duo/duo-examples.git \
&& cd duo-examples \
&& ./envsetup.sh
# Update .bashrc
RUN echo ". ~/duo-examples/envsetup.sh" >> ~/.bashrc \
&& echo "cd /home/milkv/buildroot" >> ~/.bashrc
# Set the working directory for the user
WORKDIR /home/milkv/buildroot
# Add entrypoint script
COPY entrypoint.sh /entrypoint.sh
# This entrypoint is just for Docker run commands that pass a command in, rather
# than creating an interactive terminal.
ENTRYPOINT ["/entrypoint.sh"]