Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker to use Python 3.12 #3836

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 46 additions & 15 deletions docker/Dockerfile.latest_release
Original file line number Diff line number Diff line change
@@ -1,26 +1,57 @@
FROM mcr.microsoft.com/playwright:v1.47.0-focal
FROM mcr.microsoft.com/playwright:v1.48.0-focal

# Add pip
# Install Python 3.12 and set it up
USER root
RUN apt-get update
USER root
RUN apt-get install -y python3 python3-pip
RUN apt-get install -y software-properties-common
USER root
RUN pip3 install --no-cache-dir --upgrade pip wheel
RUN add-apt-repository ppa:deadsnakes/ppa
USER root
RUN rm -rf /var/lib/apt/lists/*
RUN apt-get update
USER root
RUN apt-get install -y python3.12
USER root
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 && \
update-alternatives --set python3 /usr/bin/python3.12

# Install pip for Python 3.12
USER root
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py && \
rm get-pip.py

# Upgrade pip and install wheel
USER root
RUN pip3 install --no-cache-dir --upgrade pip wheel && \
pip3 --version && \
python3 --version

# Clean up
USER root
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set environment variables
ENV PATH="/home/pwuser/.local/bin:${PATH}"
ENV NODE_PATH=/usr/lib/node_modules
# What were these used for previously
# RUN mv /root/.cache/ /home/pwuser/.cache
# RUN chmod a+rwx -R /home/pwuser/.cache

# Cache operations
USER root
RUN mv /root/.cache/ /home/pwuser/.cache || true
RUN chmod a+rwx -R /home/pwuser/.cache || true

# Switch to pwuser for the remaining operations
USER pwuser
RUN pip3 install --no-cache-dir --upgrade pip wheel
USER pwuser
RUN pip3 --version
USER pwuser
RUN pip3 install --no-cache-dir --user --upgrade robotframework robotframework-browser==18.9.0
USER pwuser
RUN python3 -m Browser.entry init

# Upgrade pip and wheel for the user
RUN pip3 install --no-cache-dir --user --upgrade pip wheel

# Print pip version
RUN pip3 --version

# Install RobotFramework and Browser library
RUN pip3 install --no-cache-dir --user --upgrade robotframework robotframework-browser==18.9.0

# Initialize Browser library
RUN python3 -m Browser.entry init
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.