Skip to content

Commit

Permalink
🐛 fix(Dockerfile): replace hardcoded Python version with version spec…
Browse files Browse the repository at this point in the history
…ified in .config/python_version.config (vitabaks#350)

✨ feat(Dockerfile): add .config/python_version.config file to specify Python version
✨ feat(Makefile): replace hardcoded Python version with version specified in .config/python_version.config
The Dockerfile now uses the Python version specified in the .config/python_version.config file instead of a hardcoded version. This allows for easier version management and flexibility. The .config/python_version.config file is a new file that specifies the Python version to be used. The Makefile has also been updated to use the Python version specified in the .config/python_version.config file.
  • Loading branch information
ThomasSanson authored May 27, 2023
1 parent 1d4d392 commit 6529b92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .config/gitpod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ FROM ubuntu:jammy

USER root

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

# Update system and install packages, including Docker
RUN apt-get update \
# 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) && \
apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
bash-completion \
Expand All @@ -18,8 +23,8 @@ RUN apt-get update \
make \
nano \
python3-pip \
python3.10 \
python3.10-venv \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-venv \
sudo \
vim \
wget \
Expand Down
1 change: 1 addition & 0 deletions .config/python_version.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PYTHON_VERSION=3.10
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ How to use me:
endef
export HEADER

python_launcher := python3.10
python_launcher := python$(shell cat .config/python_version.config | cut -d '=' -f 2)

-include .config/make/help.mak
-include .config/make/python.mak
Expand Down

0 comments on commit 6529b92

Please sign in to comment.