Unable to update python from 3.5.3 to 3.8.5 on docker container

  docker, docker-compose, node.js, python, python-3.x

I’m trying to update my python version that runs inside a docker container, but even when i try to update the packages with apt-get update or apt update and then running apt-get install python3.8 or apt install python3.8 i got the following error:

apt install python3.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.8
E: Couldn't find any package by glob 'python3.8'
E: Couldn't find any package by regex 'python3.8'

I have already tried the answer on this link: How to Install python3.8 on debian 10?

More informations:

My docker-compose.yml

version: "3.3"
services:
  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USER}
      POSTGRES_DB: ${DB_DATABASE}
    volumes:
      - ./pgdata:/var/lib/postgres/data
    ports:
      - "${DB_PORT}:${DB_PORT}"
  web:
    image: node:12
    restart: always
    depends_on:
      - db
    ports:
      - 3000:3000
    volumes:
      - ./:/usr/app
    working_dir: /usr/app
    command: bash -c "apt-get update && apt-get install -y python3 wget && wget https://bootstrap.pypa.io/pip/3.5/get-pip.py && python3 get-pip.py && pip install opencv-contrib-python==4.1.2.30 && pip3 install numpy && pip3 install imutils && pip3 install pickle-mixin && pip3 install argparse && pip3 install requests && yarn && rm -rf get-pip.py && yarn start"
    environment:
      IMAGE_DIR_NAME: ${my_path}
      PYTHON_PATH: ${my_path}
      SCRYFALL_SCRIPT: ${my_path}
      DB_HOST: db
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "5"

How can i solve this problem?

Source: Docker Questions

LEAVE A COMMENT