How to install optional packages in Dockerfile?

Posted on

I'm porting a Dockerfile from using centos7 to the rhel7 image. The docker image needs Xvfb (needed by Java for generating images on the server side) so I need to install xorg-x11-server-Xvfb and associated dependencies. On centos7 this is easy but on rhel 7 I need to use the optional packages. Unfortunately when I run "yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional" on a generic RHEL 7 image I get the correct subscriptions setup and can install the correct rpms but when I run docker I'm not able to install the package.

What am I missing?

Thanks
Marc

Responses