5

So far I installed my additional needed stuff directly in Docker, as a "post argument".

/bin/sh -c 'apt update && apt install -y smartmontools && apt install -y lm-sensors && apt install -y nvme-cli && apt install -y ipmitool && telegraf'

This does not work anymore. The error message appears as mentioned in the headline. How can I as root continue to install these things, as a "post argument"?

System: Unraid - Docker - Telegraf:latest

David Maze
  • 130,717
  • 29
  • 175
  • 215
Da Doo Ron
  • 51
  • 1
  • 2
  • Is this a `RUN` line in your Dockerfile? You need to switch to `USER root` before you run that to be able to install packages. Those specific packages, though, you probably won't be able to run – a Docker container usually can't access the sorts of very-low-level hardware devices lm-sensors manages. – David Maze Oct 29 '21 at 17:57
  • Well, that had worked fine until last week. I suspect that the developer is now running his Docker at the user level. I'll have to write to the developer to find out what the root password is. Thanks for the quick reply. – Da Doo Ron Oct 29 '21 at 18:11
  • Docker containers don't usually have root (or other) passwords, since you can easily switch user contexts with a Dockerfile `USER` directive or a `docker run -u` option. Do you have a larger excerpt of the Dockerfile? – David Maze Oct 29 '21 at 19:05
  • Unfortunately not. But I have found another way. For the time being I don't use telegraf:latest but telegraf:17.1. This version is a bit older, but everything works again. Grafana has its data again. I have written to the developer. Maybe the intended change is related to the new InfluxDB 2.0. I had to backport a version a few weeks ago to make the interaction work. – Da Doo Ron Oct 29 '21 at 19:38

2 Answers2

1

A change to the Telegraf docker images was made to run telegraf not as the root user. This unfortunately meant that users could not install any new software. New Telegraf images are now published that allow users to again install additional software to the images. Telegraf itself is still run as the telegraf user/group, but users have access to run things as root in order to configure the image. We have a full post on why we made this change and the impact to users. Thanks!

powersj
  • 369
  • 1
  • 7
0

I believe you are using a non root container image. Read the documentation of the docker image provider to find the solution to see how you can use the image as a root container image.

Gru97
  • 471
  • 5
  • 8