-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (52 loc) · 1.7 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
58
59
60
61
62
63
64
FROM ubuntu:22.04
ENV USER=velocity
ENV UID=1000
ENV GID=1000
ENV WORKDIR=/velocity
# Vars used in scripts and entrypoint
ENV TMUX_SESSION=velocity
ENV PROJECT=velocity
# Create user and group
RUN groupadd --gid ${GID} ${USER} && \
useradd --create-home --shell /bin/bash --uid ${UID} --gid ${GID} ${USER} && \
usermod -aG sudo ${USER}
# Install dependencies
RUN apt update && apt upgrade -y && apt install -y --no-install-recommends \
vim \
curl \
software-properties-common \
ca-certificates \
apt-transport-https \
gnupg \
wget \
tmux \
jq
# Import the Amazon Corretto public key and repository
RUN curl https://apt.corretto.aws/corretto.key | apt-key add - && \
add-apt-repository 'deb https://apt.corretto.aws stable main'
# Install Java
RUN apt update && apt install -y --no-install-recommends \
java-17-amazon-corretto-jdk \
libxi6 \
libxtst6 \
libxrender1
# Install Cleanup
RUN apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/*
USER ${USER}
WORKDIR $WORKDIR
# Copy scripts folder and make them executable
COPY --chown=${USER}:${USER} scripts scripts
RUN chmod +x scripts/*
# Add commands to bashrc
RUN echo "alias start='bash $WORKDIR/scripts/start.sh'" >> ~/.bashrc && \
echo "alias stop='bash $WORKDIR/scripts/stop.sh'" >> ~/.bashrc && \
echo "alias debug='bash $WORKDIR/scripts/debug.sh'" >> ~/.bashrc \
&& echo "alias restart='bash $WORKDIR/scripts/restart.sh'" >> ~/.bashrc
# Copy entrypoint
COPY --chown=${USER}:${USER} entrypoint.sh /home/${USER}/entrypoint.sh
RUN chmod +x /home/${USER}/entrypoint.sh
ENTRYPOINT ["sh", "-c", "/home/$USER/entrypoint.sh"]