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

Run more commands in initContainers script #26

Open
pfirpfel opened this issue Oct 2, 2023 · 0 comments
Open

Run more commands in initContainers script #26

pfirpfel opened this issue Oct 2, 2023 · 0 comments

Comments

@pfirpfel
Copy link
Contributor

pfirpfel commented Oct 2, 2023

I want to expand this init script to run more commands:

- name: create-dirs
image: busybox:stable
command:
- "/bin/mkdir"
args:
- "-p"
- "/var/www/htdocs/safir-static/"
- "/var/www/htdocs/images/"
volumeMounts:
- name: www
mountPath: "/var/www/htdocs"

The first thing, that I want to add, is changing file permissions to make directories traversable:

find /var/www/htdocs -type d -exec chmod 755 -R {} \;

There are likely more such one-liners in the future, that I want to add. Booting up a container for each one of those just to run that line seems a bit overkill. Is there a good way to add more commands?

EDIT: If it's not that much overhead, I can of course use a separate init container per command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant