# Unattended installation fails during a docker build

**URL:** <https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332>\
**Category:** Ignition\
**Tags:** docker\
**Created:** [November 8, 2016, 2:30pm UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332 "2016-11-08T14:30:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdinos](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bdinos](https://forum.inductiveautomation.com/u/bdinos)\
**Post date:** [November 8, 2016, 2:30pm UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332/1 "2016-11-08T14:30:59Z")

</div>

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](https://s3.amazonaws.com/files.inductiveautomation.com/release/ia/build7.9.0/20161012-0855/Ignition-7.9.0-linux-x64-installer.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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 8, 2016, 3:04pm UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332/2 "2016-11-08T15:04:14Z")

</div>

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](https://inductiveautomation.com/forum/viewtopic.php?f=64&t=8060&hilit=+kickstart) is likely to be a good starting point.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 8, 2016, 8:44pm UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332/3 "2016-11-08T20:44:15Z")

</div>

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:

```auto
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
```

---

<div class="post-metadata">

**Author:** ![bdinos](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bdinos](https://forum.inductiveautomation.com/u/bdinos)\
**Post date:** [November 9, 2016, 4:35am UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332/4 "2016-11-09T04:35:11Z")

</div>

It worked well. Thanks! ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":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]

---

<div class="post-metadata">

**Author:** ![Kevin.Collins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.collins/32/13497_2.png) [@Kevin.Collins](https://forum.inductiveautomation.com/u/Kevin.Collins)\
**Post date:** [November 12, 2017, 8:06pm UTC](https://forum.inductiveautomation.com/t/unattended-installation-fails-during-a-docker-build/12332/5 "2017-11-12T20:06:15Z")

</div>

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

[https://hub.docker.com/r/kcollins/ignition/](https://hub.docker.com/r/kcollins/ignition/)

Feedback welcome!
