Skip to content

Commit e69f203

Browse files
authored
Resolves Multiple Issues and Enhances Docker Setup (vitabaks#352)
* 🐛 fix(Dockerfile): fix apt-get install command to properly install python version The apt-get install command was not properly installing the desired python version due to the quotes being removed from the package names. This commit adds quotes to the package names to ensure that the correct version of python is installed. * 🐛 fix(Dockerfile): use correct command to extract python version from config file The command to extract the python version from the config file was incorrect. The cut command was used instead of cat to extract the value of the python version. The cut command was updated to extract the value of the python version from the config file. * 🔧 chore(Dockerfile): add npm and ungit to the Dockerfile The Dockerfile has been updated to include the installation of npm and ungit. This is useful for development purposes as it allows developers to easily visualize and manage their git repositories. * 🔧 chore(Dockerfile): add tree package to improve development experience The tree package has been added to the Dockerfile to improve the development experience by allowing developers to easily visualize the directory structure of the project. * 🚀 feat(Dockerfile): add variables for npm and ungit versions and use them to install the specified versions The Dockerfile now includes two variables, NPM_VERSION and UNGIT_VERSION, which are used to install the specified versions of npm and ungit respectively. This allows for easier version management and ensures that the correct versions are installed.
1 parent 00b5222 commit e69f203

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Diff for: .config/gitpod/Dockerfile

+19-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ FROM ubuntu:jammy
22

33
USER root
44

5+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
6+
57
# Copy Python version config file
68
COPY .config/python_version.config /tmp/
79

10+
# Set a variable for the npm version
11+
ARG NPM_VERSION=9.6.7
12+
# Set a variable for the ungit version
13+
ARG UNGIT_VERSION=1.5.23
14+
815
# Update system and install packages, including Docker
9-
# Replace "python3.10" with "$(cat /tmp/python_version.txt)" in the apt-get install command
10-
RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
16+
# Replace "python3.10" with "$(cut -d '=' -f 2 /tmp/python_version.config)" in the apt-get install command
17+
# hadolint ignore=DL3008,DL3013
18+
RUN PYTHON_VERSION=$(cut -d '=' -f 2 /tmp/python_version.config) && \
1119
apt-get update \
1220
&& apt-get upgrade -y \
1321
&& apt-get install -y --no-install-recommends \
@@ -23,9 +31,10 @@ RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
2331
make \
2432
nano \
2533
python3-pip \
26-
python${PYTHON_VERSION} \
27-
python${PYTHON_VERSION}-venv \
34+
"python${PYTHON_VERSION}" \
35+
"python${PYTHON_VERSION}-venv" \
2836
sudo \
37+
tree \
2938
vim \
3039
wget \
3140
&& python3 -m pip install --no-cache-dir --upgrade pip \
@@ -36,6 +45,12 @@ RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
3645
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
3746
&& apt-get update \
3847
&& apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io \
48+
# Install npm and ungit using the versions specified in the variables
49+
&& curl -fsSL https://deb.nodesource.com/setup_20.x |bash - \
50+
&& apt-get install -y --no-install-recommends nodejs \
51+
&& npm install -g npm@${NPM_VERSION} \
52+
&& npm install -g \
53+
ungit@${UNGIT_VERSION} \
3954
# Clean
4055
&& apt-get clean && rm -rf /var/lib/apt/lists/* tmp/*
4156

0 commit comments

Comments
 (0)