Sudo install through Dockerfile

Hi all,

I need to install a software called Poppler. I really tried to find how I could install without sudoing, but I cannot really find anything. The fastest option I find is just:

sudo apt-get install -y poppler-utils

However, I cannot sudo anything. How could I sort this out? Any other options or ideas?

Thank you in advance!
Cheers
Luis

Hi @lusamino, you should see this section in your Dockerfile which by default is there but it is commented out. So you should uncomment the whole section, and replace the example packages with the package you mentioned. You should not need to add the sudo command because this will run as the root user due to the USER root command that preceeds it and the root user already has sudo privileges. But do let me know if this does not work for some reason.

This is what the example section looks like when uncommented:

USER root
RUN apt-get update && \
   apt-get install -y --no-install-recommends \
   apt-utils \
   vim
USER ${NB_USER}

This is what your section should look like:

USER root
RUN apt-get update && \
   apt-get install -y --no-install-recommends \
   poppler-utils
USER ${NB_USER}

Wow, that was easy, and it was already there :sweat_smile: Thanks @tolevski , super helpful, as always!