Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Run a terminal command before docker container starts

Featured Replies

I'm trying to get a specific container to remove a file before the container is started. but i can't quite seem to get it to work

 

running "rm /mnt/user/storage/file.txt" from outside the container in the unraid temrinal works fine,

and running "rm /storage/file.txt" (where /mnt/user/storage:/storage) from inside the container console both work fine. but i cant seem to get the logic in the docker container settings.

 

i've tried both commands in the post arguments box but neither seems to run so i'm not sure what i'm supposed to do here.

Thanks!

Edited by MammothJerk

  • Author

read other issues in this subforum and found my solution

&& docker exec containername sh -c 'rm /storage/file.txt'

 

So apparently this script only runs when the container is rebuilt, and not on start/restart

 

So i'm still looking for a solution

Edited by MammothJerk

  • MammothJerk changed the title to Run a terminal command before docker container starts
  • 3 weeks later...
  • Author

i emailed the unraid support as well but they said they dont support docker lol.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.