-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
57 lines (45 loc) · 1.36 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Created by: VPR
# Created: February 22th, 2025
# Updated by: VPR
# Updated: February 22th, 2025
FROM ubuntu:24.04
# Set env to avoid user input interruption during installation
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install required packages
RUN apt-get update && apt upgrade -y
RUN apt-get install -y --no-install-recommends \
wget \
curl \
ca-certificates \
build-essential \
cmake \
mingw-w64
RUN update-ca-certificates
# Create working environment
WORKDIR /opt/ephemeral-blue
# Copy sources
COPY ephemeral-blue ephemeral-blue
COPY CMakeLists.txt CMakeLists.txt
COPY mingw-toolchain.cmake mingw-toolchain.cmake
# Set docker user to local user uid:gid
ARG LOCAL_USER
ARG LOCAL_UID
ARG LOCAL_GID
RUN if getent group $LOCAL_GID > /dev/null; \
then \
groupmod -n $LOCAL_USER `getent group $LOCAL_GID | cut -f1 -d:`; \
else \
groupadd -g $LOCAL_GID $LOCAL_USER; \
fi
RUN if getent group $LOCAL_UID > /dev/null; \
then \
usermod -l $LOCAL_USER -d /home/$LOCAL_USER -m `getent passwd 1000 | cut -f1 -d:`; \
else \
useradd -m -u $LOCAL_UID -g $LOCAL_GID -s /bin/bash $LOCAL_USER; \
fi
RUN chown -R $LOCAL_USER:$LOCAL_USER /opt/ephemeral-blue
# Install testing suite
# Become user
USER $LOCAL_USER
ENV HOME=/home/$LOCAL_USER