I want a install influxdb into a container. The project's web page says that RedHat and CentOS users can install by downloading and installing the rpm like this:
# 64-bit system install instructions
wget http://influxdb.s3.amazonaws.com/influxdb-0.9.3-1.x86_64.rpm
sudo yum localinstall influxdb-0.9.3-1.x86_64.rpm
I'm clever, so after downloading the file, I try this instead:
root [ ~ ]# tdnf install influxdb-0.9.3-1.x86_64.rpm
Error(905) : Nothing to do
root [ ~ ]# tdnf info influxdb-0.9.3-1.x86_64.rpm
Error(1011) : No matching packages to list
So, how do I install an rpm with tdnf?
Building a .service file turned out to be overkill. After briefly growing to a huge mess, my final Dockerfile looks like this:
FROM vmware/photon
MAINTAINER sam.denton@emc.com
ADD http://influxdb.s3.amazonaws.com/influxdb-0.9.3-1.x86_64.rpm my.rpm
RUN rpm --install my.rpm --noscripts
RUN ln -s /opt/influxdb/versions/0.9.3/influx /usr/local/bin/.
EXPOSE 8086
CMD ["/opt/influxdb/versions/0.9.3/influxd"]
The "ln" seemed easier than adding the installation directory to my PATH, and lets me run the administrative CLI via docker exec. There's still a couple of tweaks to make, like setting up a VOLUME to hold the database, but this seems to be working well for me.
Apparently, the best option is to skip tdnf and just use the rpm command.
rpm --install influxdb-0.9.3-1.x86_64.rpm --noscripts
The --noscripts is because the package wants to set up init.d for me, and as we all know, Photon uses systemd. So, along with adding RUN commands for about half of the post-install script, I need to build an influxdb.service file. I see a pull request in my future, once i work all this out.
Building a .service file turned out to be overkill. After briefly growing to a huge mess, my final Dockerfile looks like this:
FROM vmware/photon
MAINTAINER sam.denton@emc.com
ADD http://influxdb.s3.amazonaws.com/influxdb-0.9.3-1.x86_64.rpm my.rpm
RUN rpm --install my.rpm --noscripts
RUN ln -s /opt/influxdb/versions/0.9.3/influx /usr/local/bin/.
EXPOSE 8086
CMD ["/opt/influxdb/versions/0.9.3/influxd"]
The "ln" seemed easier than adding the installation directory to my PATH, and lets me run the administrative CLI via docker exec. There's still a couple of tweaks to make, like setting up a VOLUME to hold the database, but this seems to be working well for me.