Unattended installation fails during a docker build

Greetings,
I am attempting to build a docker container for Ignition. The build fails during the installation with the following error:

Problem running post-install step. Installation may not complete correctly
Error running chown /usr/local/bin/ignition/.: chown: missing operand after ‘/usr/local/bin/ignition/.’
Try ‘chown --help’ for more information.

In my Dockerfile I have the following:
RUN wget -nv s3.amazonaws.com/files.inductiv … taller.run
RUN chmod u+x Ignition-7.9.0-linux-x64-installer.run
#The following line fails:
RUN ./Ignition-7.9.0-linux-x64-installer.run --mode unattended --unattendedmodeui minimal

I have also attempted the following variations with no luck (the same error is displayed):

  1. Build the container running as a different user having root privileges. In this case I have the following commands preceeding:
    RUN useradd -ou 0 -g 0 -ms /bin/bash ignition
    USER ignition
    WORKDIR /home/ignition
  2. Use the serviceuser parameter
    RUN ./Ignition-7.9.0-linux-x64-installer.run --mode unattended --unattendedmodeui minimal - – serviceuser ignition
  3. Use the prefix parameter
    RUN ./Ignition-7.9.0-linux-x64-installer.run --mode unattended --unattendedmodeui minimal --prefix /abc/bin/ignition

Any idea what is going on? Clearly the post-install step invokes ‘chown’ with a wrong syntax.

Thanks, Dino

Consider using a scripted install from the zip file instead of the .run file. You’ll have a great deal of control of just how Ignition runs in your container. The kickstart for Ubuntu VMs in this topic is likely to be a good starting point.

The reason for the failure is the installer is looking for a sudo-level user to execute that command, and the image doesn’t have one defined, which is why that command is missing a username to attribute ownership of the files.

You can have your Dockerfile run the installer, but it’s probably easier to deploy using the zip file, as Phil suggested.

If you must use the executable, you’ll need to have your Dockerfile create a user under the sudo group, set the sudoers file to allow the Ignition installer to be run as sudo without a password, and then run the installer as sudo. Also be sure to install sudo if your base image doesn’t have it (my base image did not). Here is an example snippet from a Dockerfile:

RUN apt-get update && apt-get -y install sudo
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo
RUN echo "docker ALL = NOPASSWD: /path/to/installer" >> /etc/sudoers
RUN chmod u+x /path/to/installer
USER docker
RUN sudo /path/to/./installer --mode unattended --unattendedmodeui minimal

It worked well. Thanks! :thumb_right:

[quote=“James.Lorenz”]The reason for the failure is the installer is looking for a sudo-level user to execute that command, and the image doesn’t have one defined, which is why that command is missing a username to attribute ownership of the files.

You can have your Dockerfile run the installer, but it’s probably easier to deploy using the zip file, as Phil suggested.

If you must use the executable, you’ll need to have your Dockerfile create a user under the sudo group, set the sudoers file to allow the Ignition installer to be run as sudo without a password, and then run the installer as sudo. Also be sure to install sudo if your base image doesn’t have it (my base image did not). Here is an example snippet from a Dockerfile:

RUN apt-get update && apt-get -y install sudo RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo RUN echo "docker ALL = NOPASSWD: /path/to/installer" >> /etc/sudoers RUN chmod u+x /path/to/installer USER docker RUN sudo /path/to/./installer --mode unattended --unattendedmodeui minimal [/quote]

I’ve recently made some efforts toward Docker-based Ignition deployments here:

https://hub.docker.com/r/kcollins/ignition/

Feedback welcome!