List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
Asked Answered
G

3

7

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

Godred answered 29/10, 2021 at 17:21 Comment(4)
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.Striction
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.Godred
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?Striction
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.Godred
I
2

Try that:

USER root

# Install packages you need:
RUN apt-get update && apt-get install -y curl

# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID
Iasis answered 18/2, 2024 at 6:47 Comment(0)
M
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!

Menides answered 3/11, 2021 at 22:51 Comment(0)
O
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.

Orpheus answered 4/2, 2022 at 5:47 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.