Repository navigation
setup
This document explains the entire lifecycle of getting DAM onto (and off) your system. It covers the installation wizard, system integration, configuration refreshing, and the complete uninstallation process.
When run without arguments, the install command launches an interactive wizard to configure DAM globally.
sudo ./dam.sh installIf an existing configuration file is found at /etc/docker-app-manager.conf, DAM will prompt:
Do you want to just update the script and keep your existing settings? (Y/n)
- Yes: Skips the configuration wizard and proceeds directly to reinstalling symlinks.
- No: Proceeds to the configuration wizard, pre-filling defaults based on your existing config.
DAM prompts for the locations of your Docker Compose apps.
-
Default:
/opt/stacks /opt/projects ~/apps ~/stacks(resolved to the actual user's home directory if usingsudo). - Validation: DAM checks if the paths contain spaces (which are unsupported) and warns you if a specified directory does not currently exist.
DAM prompts for folder names to permanently ignore during scans.
- Useful for skipping folders like
recovered,backups, orunused.
DAM configures how you invoke it globally.
-
Raw Commands: If you enter
none, DAM creates global symlinks for every individual action (start,stop,update, etc.). DAM will aggressively scan your system'sPATHto ensure these generic names don't conflict with existing system binaries.⚠️ WARNING: Raw Mode is NOT recommended unless you are an advanced Linux user. Hijacking extremely common words likestart,stop, orupdatein/usr/local/bincan break completely unrelated applications, cron jobs, or system utilities that rely on those verbs. -
Custom Prefix: The recommended approach. If you enter a name like
dkr,dam, orapp, DAM creates a single symlink, allowing you to run commands likedkr update <app-name>.
-
Custom Update Scripts: DAM asks whether
update*.shscripts should execute automatically (true) or require interactive confirmation (false) during anupdateaction. -
Update SHA-256: For strict security environments, you can specify a SHA-256 hash that the
self-updatecommand must verify before applying any new script versions.
- DAM saves your choices to
/etc/docker-app-manager.conf. - It installs
/usr/local/bin/docker-app-manager: a temporary source under/tmpor/var/tmpis copied there, while a persistent source is linked so its edits are immediately live globally. - It cleans up any old, orphaned symlinks if you changed your command name.
- It creates the new command symlinks based on your choices. Note that
frecis created as an alias forforce-recreate.
While running sudo ./dam.sh install again will perfectly update your existing installation (via an interactive (Y/n) prompt), the refresh argument serves a very specific, crucial purpose: Non-interactive execution.
The refresh argument is designed to be used by the self-update system and automated scripts (like cron jobs). When self-update downloads a new version of DAM, that new version might introduce entirely new commands (e.g., if a debug command is added in v1.2). Because self-update runs in the background, it cannot get stuck waiting for a human to answer interactive prompts.
Instead, it calls install refresh, which silently re-reads your existing /etc/docker-app-manager.conf, rebuilds all necessary system symlinks to expose any new commands, and exits immediately with zero prompts. You can also use this manually if you hand-edit the config file and want to apply the changes instantly.
sudo ./dam.sh install refresh(Note: If you already have DAM installed globally, you can also run sudo dkr install refresh)
- Ensures a directly invoked source is installed as the core executable, copying a temporary source and linking a persistent one; an existing global core executable is left intact.
- Sources
/etc/docker-app-manager.conf. - Force-removes all currently managed symlinks in
/usr/local/bin. - Re-creates the symlinks based strictly on the
CUSTOM_CMD_NAMEdefined in the config. - Exits silently with code 0 on success.
-
Main Script Path: For a persistent-source installation, do not delete the original
dam.sh, because the global core executable links to it. The temporary script used by Quick Install can be deleted after setup. -
Configuration File:
/etc/docker-app-manager.conf -
Global Binary:
/usr/local/bin/docker-app-manager, a copied executable for temporary sources or a symlink for persistent sources -
User Commands:
/usr/local/bin/<your-custom-name>or/usr/local/bin/start, etc.
The uninstall command is designed to cleanly remove the DAM installation from the host system. It reverses the actions performed by the install command, ensuring that no dangling symlinks or configuration files remain.
sudo dkr uninstallNote on Raw Mode: If you configured DAM in "raw mode" (where none was selected during installation and individual action symlinks were created), you must use the underlying script directly to uninstall:
sudo docker-app-manager uninstallWhen the uninstall command is invoked, DAM performs the following steps sequentially:
-
Privilege Verification: DAM checks if the command is being run with
rootprivileges. Because it needs to remove files from/usr/local/binand/etc, it will immediately fail with an error if run as a standard user. -
Symlink Cleanup: Instead of blindly removing files, DAM dynamically determines what symlinks were created:
- It reads the
CUSTOM_CMD_NAMEfrom/etc/docker-app-manager.conf. - If a custom name (e.g.,
dkr) was used, it attempts to remove/usr/local/bin/dkr. - If raw mode was used (empty string
""), DAM loops through its internal array of supported actions (start,stop,update, etc.) and removes the corresponding symlinks in/usr/local/bin/. -
Safety Check: Before deleting any symlink, DAM uses
readlink -fto verify that the symlink actually points to/usr/local/bin/docker-app-manager. If a user manually created a command with the same name that points elsewhere, DAM will skip it.
- It reads the
-
Core Binary Removal: DAM deletes the main script (
rm -f /usr/local/bin/docker-app-manager). -
Configuration File Removal: DAM removes the global configuration file (
rm -f /etc/docker-app-manager.conf).
The uninstall command is strictly scoped to the DAM utility itself. It does not touch your Docker applications or resources.
Specifically, it will not:
- Delete any containers, networks, or volumes.
- Delete or modify any of your Docker Compose project directories.
- Remove Docker or the Docker Compose plugin from your system.
- Prune any Docker images or cache.