Skip to content

Commit

Permalink
Resolves Multiple Issues and Enhances Docker Setup (vitabaks#352)
Browse files Browse the repository at this point in the history
* 🐛 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.
  • Loading branch information
ThomasSanson authored May 28, 2023
1 parent 00b5222 commit e69f203
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .config/gitpod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ FROM ubuntu:jammy

USER root

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Copy Python version config file
COPY .config/python_version.config /tmp/

# Set a variable for the npm version
ARG NPM_VERSION=9.6.7
# Set a variable for the ungit version
ARG UNGIT_VERSION=1.5.23

# Update system and install packages, including Docker
# Replace "python3.10" with "$(cat /tmp/python_version.txt)" in the apt-get install command
RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
# Replace "python3.10" with "$(cut -d '=' -f 2 /tmp/python_version.config)" in the apt-get install command
# hadolint ignore=DL3008,DL3013
RUN PYTHON_VERSION=$(cut -d '=' -f 2 /tmp/python_version.config) && \
apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
Expand All @@ -23,9 +31,10 @@ RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
make \
nano \
python3-pip \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-venv \
"python${PYTHON_VERSION}" \
"python${PYTHON_VERSION}-venv" \
sudo \
tree \
vim \
wget \
&& python3 -m pip install --no-cache-dir --upgrade pip \
Expand All @@ -36,6 +45,12 @@ RUN PYTHON_VERSION=$(cat /tmp/python_version.config | cut -d '=' -f 2) && \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io \
# Install npm and ungit using the versions specified in the variables
&& curl -fsSL https://deb.nodesource.com/setup_20.x |bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g npm@${NPM_VERSION} \
&& npm install -g \
ungit@${UNGIT_VERSION} \
# Clean
&& apt-get clean && rm -rf /var/lib/apt/lists/* tmp/*

Expand Down

0 comments on commit e69f203

Please sign in to comment.