-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (52 loc) · 1.68 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
65
66
# Use the official Ubuntu 20.04 base image
FROM --platform=linux/amd64 ubuntu:20.04
# Set environment variables
ENV PYTHON_VERSION=3.9
ENV GOLANG_VERSION=1.17
# Prevents prompts during package installations
ARG DEBIAN_FRONTEND=noninteractive
# Update the package list and install necessary dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
ca-certificates \
curl \
cron \
wget \
build-essential \
git \
unzip \
tzdata \
vim
# Install Python
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils \
python${PYTHON_VERSION}-venv \
python3-pip
# Set Python as the default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Install Golang
RUN wget -q https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
rm go${GOLANG_VERSION}.linux-amd64.tar.gz
# Set Go environment variables
ENV GOPATH=/go
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m -s /bin/bash user
# Set the working directory
WORKDIR /home/user
# Optionally install software or make changes to the user folder here
#
#Change ownership of Home directory
RUN chown -R user /home/user
USER user
CMD ["bash"]