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

Use Post-start hooks to replace all cmd.sh combined with ENTRYPOINT and COMMAND #945

Open
chendelin1982 opened this issue Nov 15, 2024 · 0 comments
Labels
feature Type label, New feature or request

Comments

@chendelin1982
Copy link
Contributor

What type of your feature request?

Websoft9 have add cmd.sh together with ENTRYPOINT and COMMAND, but it may make container error

Post-start hooks are commands that run after the container has started, but there's no set time for when exactly they will execute.

services:
  app:
    image: backend
    user: 1001
    volumes:
      - data:/data    
    post_start:
      - command: chown -R /data 1001:1001
        user: root

volumes:
  data: {} # a Docker volume is created with root ownership

It can be used after Docker Compose v2.30

@chendelin1982 chendelin1982 added the feature Type label, New feature or request label Nov 15, 2024
@chendelin1982 chendelin1982 changed the title Use Post-start hooks to replace all cmd.sh Use Post-start hooks to replace all cmd.sh combined with ENTRYPOINT and COMMAND Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Type label, New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant