Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Improve Docker image usability by adding WORKDIR /etc/netdata #17890

Open
powerman opened this issue Jun 14, 2024 · 9 comments
Open

[Feat]: Improve Docker image usability by adding WORKDIR /etc/netdata #17890

powerman opened this issue Jun 14, 2024 · 9 comments
Labels
docker docker related issues feature request New features

Comments

@powerman
Copy link
Contributor

Problem

Most of commands executed inside a docker container are ./edit-config, which must be run in /etc/netdata. So, each time after docker exec we have to run cd /etc/netdata, which is a bit annoying.

Description

Make /etc/netdata default directory inside docker container.

Importance

nice to have

Value proposition

  1. Less commands to run each time we need to reconfigure netdata in a docker.
  2. Less errors because of forgotten cd.
  3. Better overall UX for docker deployments. 😄

Proposed implementation

Add WORKDIR /etc/netdata near the bottom of the Dockerfile.

@powerman powerman added feature request New features needs triage Issues which need to be manually labelled labels Jun 14, 2024
@ilyam8
Copy link
Member

ilyam8 commented Jun 14, 2024

Hey, @powerman. Please open one issue with all your suggestions.

@ilyam8 ilyam8 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
@powerman
Copy link
Contributor Author

Hey, @powerman. Please open one issue with all your suggestions.

Sorry, I don't get it. These suggestions are not related, they should be handled independently, some may be accepted while other rejected… so what's the point in mixing them all in a single issue? Every other project insist on making separate issues/PRs for everything which can be separated…

If you want to have one my issue max then just reopen any one from just closed ones, no matter which one.

@ilyam8
Copy link
Member

ilyam8 commented Jun 14, 2024

All of them are about "Install Netdata with Docker" documentation. You can open one issue and list all your suggestions. Thanks!

@ilyam8
Copy link
Member

ilyam8 commented Jun 14, 2024

I'm sorry, I meant #17892, #17891, and #17893. Not this one.

@Ferroin what do you think about this request?

@ilyam8 ilyam8 reopened this Jun 14, 2024
@ilyam8 ilyam8 added docker docker related issues and removed needs triage Issues which need to be manually labelled labels Jun 14, 2024
@Ferroin
Copy link
Member

Ferroin commented Jun 14, 2024

The question comes down to whether the entrypoint script and the agent itself actually correctly handle being run in /etc/netdata instead of /. That said, if docker exec /etc/netdata/edit-config does not work but opening a shell, changing directory, and running edit-config does, that’s a bug in the edit-config script.

@powerman
Copy link
Contributor Author

Hmm. To me it's a different thing. docker exec /etc/netdata/edit-config works okay. But with WORKDIR set docker exec ./edit-config will work.

@ilyam8
Copy link
Member

ilyam8 commented Jun 14, 2024

Should we just ln -s /etc/netdata/edit-config /usr/bin/? Will it do?

@powerman
Copy link
Contributor Author

Good idea! But it won't make WORKDIR change useless - when in a container if you're in /etc/netdata then you can use shell auto-complete for existing config files. So, to me both adding symlink into /usr/bin (or, better, /usr/local/sbin) and WORKDIR /etc/netdata will provide best UX.

@powerman
Copy link
Contributor Author

FWIW Here is one-liner example to debug plugins in docker:

sudo -u netdata -EH env -C /usr/libexec/netdata/plugins.d ./go.d.plugin -d -m nvidia_smi

Maybe worth to add it somewhere in the docs too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker docker related issues feature request New features
Projects
None yet
Development

No branches or pull requests

3 participants