How to install python in a docker image?

RUN apt-get update

RUN apt-get install -y python3

As hinted by:

Acquire (13: Permission denied)

I believe this is due to your base image:

https://github.com/SeleniumHQ/docker-selenium/blob/master/NodeChrome/Dockerfile

As you can see it swaps from the default user context of ‘root’ to ‘seluser’.

You can either:

  1. wear this as a consequence of the base image (i.e. use sudo)
  2. swap back: USER root
  3. or consider creating your own docker image to avoid swapping in the first place

Using sudo is best avoided in Dockerfiles where possible, so it would be preferable to go with option #2 or #3, rather than #1.

Hope that helps mate.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)