Skip to content

Commit 57d7d18

Browse files
committed
fix(azure): replace EOL python3.6 in Docker image
python3.6 is no longer on deadsnakes/apt for the Azure cudagl base (#9778). Prefer python3.8 when available; otherwise distro python3. Align entrypoint.
1 parent d109f0d commit 57d7d18

2 files changed

Lines changed: 28 additions & 27 deletions

File tree

azure/docker/Dockerfile

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,53 @@
11
FROM nvidia/cudagl:9.0-devel
22

3-
RUN apt-get update
4-
RUN apt-get install \
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
54
sudo \
65
libglu1-mesa-dev \
76
xdg-user-dirs \
87
pulseaudio \
9-
sudo \
108
x11-xserver-utils \
119
unzip \
1210
wget \
1311
software-properties-common \
14-
-y --no-install-recommends
15-
16-
RUN apt-add-repository ppa:deadsnakes/ppa
17-
RUN apt-get update
18-
RUN apt-get install -y \
19-
python3.6 \
20-
python3-pip
21-
22-
RUN python3.6 -m pip install --upgrade pip
12+
ca-certificates \
13+
&& rm -rf /var/lib/apt/lists/*
2314

24-
RUN python3.6 -m pip install setuptools wheel
15+
# python3.6 is no longer available (issue #9778). Use deadsnakes Python 3.8 when present;
16+
# otherwise fall back to the distro python3 package.
17+
RUN apt-get update \
18+
&& (apt-add-repository -y ppa:deadsnakes/ppa || true) \
19+
&& apt-get update \
20+
&& (apt-get install-y python3.8 python3.8-distutils \
21+
|| apt-get install -y python3 python3-pip) \
22+
&& if command -v python3.8 >/dev/null 2>&1; then \
23+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 || true; \
24+
python3.8 -m pip install --upgrade pip setuptools wheel || python3 -m pip install --upgrade pip setuptools wheel; \
25+
else \
26+
python3 -m pip install --upgrade pip setuptools wheel; \
27+
fi \
28+
&& rm -rf /var/lib/apt/lists/*
2529

26-
RUN adduser --force-badname --disabled-password --gecos '' --shell /bin/bash airsim_user && \
27-
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
28-
adduser airsim_user sudo && \
29-
adduser airsim_user audio && \
30+
RUN adduser --force-badname --disabled-password --gecos '' --shell /bin/bash airsim_user && \
31+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
32+
adduser airsim_user sudo && \
33+
adduser airsim_user audio && \
3034
adduser airsim_user video
3135

3236
USER airsim_user
3337
WORKDIR /home/airsim_user
3438

3539
# Change the following values to use a different AirSim binary
3640
# Also change the AIRSIM_EXECUTABLE variable in docker-entrypoint.sh
37-
ENV AIRSIM_BINARY_ZIP_URL=https://github.com/microsoft/AirSim/releases/download/v1.3.1-linux/Blocks.zip
41+
ENV AIRSIM_BINARY_ZIP_URL=https://github.com/microsoft/AirSim/releases/download/v1.3.1-linux/Blocks.zip
3842
ENV AIRSIM_BINARY_ZIP_FILENAME=Blocks.zip
3943

4044
ENV SDL_VIDEODRIVER_VALUE=offscreen
4145
ENV SDL_HINT_CUDA_DEVICE=0
4246

43-
# Download and unzip the AirSim binary
44-
RUN wget -c $AIRSIM_BINARY_ZIP_URL
45-
RUN unzip $AIRSIM_BINARY_ZIP_FILENAME
46-
RUN rm $AIRSIM_BINARY_ZIP_FILENAME
47+
RUN wget -c $AIRSIM_BINARY_ZIP_URL \
48+
&& unzip $AIRSIM_BINARY_ZIP_FILENAME \
49+
&& rm $AIRSIM_BINARY_ZIP_FILENAME
4750

48-
# Add the Python app to the image
4951
ADD ./app /home/airsim_user/app
5052

5153
WORKDIR /home/airsim_user
@@ -57,7 +59,6 @@ RUN sudo chown -R airsim_user /home/airsim_user
5759

5860
WORKDIR /home/airsim_user/app
5961

60-
# Install Python requirements
61-
RUN python3.6 -m pip install -r requirements.txt
62+
RUN python3 -m pip install --user -r requirements.txt
6263

63-
ENTRYPOINT /home/airsim_user/docker-entrypoint.sh
64+
ENTRYPOINT /home/airsim_user/docker-entrypoint.sh

azure/docker/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ echo Waiting 10 seconds before starting app...
88
sleep 10
99

1010
echo Starting Python app
11-
python3.6 /home/airsim_user/app/multirotor.py
11+
python3 /home/airsim_user/app/multirotor.py

0 commit comments

Comments
 (0)