Question
Dmitrii Baranov · Nov 5

Docker image/container - use aptitude

Hi,
The IRIS Health Docker image comes with Java 1.8 but I need OpenJDK 11. How could I install that using aptitude or somehow else?
The apt-get command requires elevation but if I rewrite the command with sudo apt-get it won't build with error message /bin/sh: sudo: not found
Is it possible to do what I want?

Product version: IRIS 2022.1
$ZV: 2022.1.1.374.0
2
0 106
Discussion (3)2
Log in or sign up to continue

In your docker build try this sequence:

USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openjdk-11-jdk
USER ${ISC_PACKAGE_MGRUSER}


Or install sudo (very bad practice in containers):

USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl gnupg ca-certificates sudo
RUN /bin/echo -e ${ISC_PACKAGE_MGRUSER}\\tALL=\(ALL\)\\tNOPASSWD: ALL >> /etc/sudoers
RUN sudo -u ${ISC_PACKAGE_MGRUSER} sudo echo enabled passwordless sudo-ing for ${ISC_PACKAGE_MGRUSER}
USER ${ISC_PACKAGE_MGRUSER}

Hi @Dmitrii Baranov!

Check this basic iris-dev template on the Open Exchange. As you can see it installs git in Dockerfile changing user to root and back to iris-owner:

## install git
## USER root   
##RUN apt update && apt-get -y install git
##USER ${ISC_PACKAGE_MGRUSER}

if uncommented it installs git via user root. I hope this is what you wanted.