Skip to content

Conversation

@joshuacurtiss
Copy link
Member

The improvements in this PR focus around adjusting our project to be an ephemeral installer, rather than a cloned project that permanently resides somewhere on the system.

Obviously, this means any pertinent code that is required for execution must be installed somewhere. So, for stacks, their compose files are general stored in /etc/stackname along with any other configuration they may keep. Additional scripts are stored in /usr/bin on Linux systems and /usr/local/bin on macOS systems.

  • Scripts were modified to report their version/build. This is important once they've been installed on a system so we can know what version we're dealing with.
  • Scripts are installed at /usr/bin or /usr/local/bin and stacks are installed at /etc/stackname.
  • When "dev mode" is used, stacks will be created from the compose files in the project directory, and symlinks will be installed in /usr/bin or /usr/local/bin. This is similar to previous behavior, and is handy for actual development of the docker-host project.

Additional important improvements:

  • Eliminated the need for a docker shim in Podman installations. Scripts would use the commands docker and docker-compose even on Podman installations, just expecting shims to be present to run podman and podman-compose. Now, the scripts intelligently differentiate between docker and podman.

Testing

To test, preferably use a fresh OS and run the installer from this branch, like this:

bash <(curl -H 'Cache-Control: no-cache, no-store' -o- https://raw.githubusercontent.com/uicpharm/docker-host/jcurt/podman-and-ephemeral-installer/init.sh) -b jcurt/podman-and-ephemeral-installer

Docs

For your convenience, here is a copy of the help screen of the main init.sh script:

   ___             __               __ __           __ 
  / _ \ ___  ____ / /__ ___  ____  / // /___   ___ / /_
 / // // _ \/ __//  '_// -_)/ __/ / _  // _ \ (_-</ __/
/____/ \___/\__//_/\_\ \__//_/   /_//_/ \___//___/\__/ 

Containerization on UIC Pharmacy servers (v1.0.0 build 5854dd31)

Usage: ./init.sh [OPTIONS]

Sets up an OS for container tooling and installs additional useful scripts for
container management according to UIC Pharmacy standards:

   - deploy: Helps deploy a stack.
   - publish: Takes a Dockerfile and publishes multi-arch images.
   - podman-install-service: Installs a Podman pod as a service.

Options:
-h, --help         Show this help message and exit.
-d, --dev          Install in developer mode, just create a symlink.
-b, --branch       Branch to use for installation files.
    --stacks-only  Only run the stack installation.
    --runner-only  Only run the GitHub Actions runner installation.
-V, --version      Print version and exit.

@joshuacurtiss joshuacurtiss added the enhancement New feature or request label Aug 27, 2025
@joshuacurtiss
Copy link
Member Author

Whereas not absolutely required, I suggest reviewing this PR after merging #34.

Add ability for scripts that are installed to the system to output a version and build
hash.
The script is improved to handle either environments with Docker or Podman in a more
effective way:

- Do not rely on `docker` shim for podman
- Detect which tool exists and execute it directly instead of using shims
Instead of cloning the project and keeping it around, the project is adjusted to be
ephemeral, being downloaded to a temp directory just for the installation process. All
pertinent yaml or scripts are installed.

That said, a dev mode is supported, which will continue the pattern of using symlinks,
which is useful for development.

Also, improved the installer to not require running as root or with sudo. It will look at
the OS flavor and run sudo if necessary. For instance, macOS should not use sudo, but
other Linux flavors should.

As a result of the entire project not being saved on the system, installation is adjusted
to save needed scripts/configurations elsewhere:

- Stacks are saved to `/etc/stackname` (or in non-root installations like macOS, they are
  saved to `$HOME/.stackname`), like /etc/nginxproxymanager. If installing in dev mode, it
  will bring up the stack using the yaml files right in the repo.
- Reusable scripts like `deploy` and `publish` are saved in /usr/bin for Linux flavors and
  /usr/local/bin for macOS. If installing in dev mode, it will symlink the scripts.
  Otherwise, it will run `install` to copy the scripts to the bin directory.
@joshuacurtiss joshuacurtiss force-pushed the jcurt/podman-and-ephemeral-installer branch from c6d9da7 to 5288e3d Compare August 28, 2025 16:58
@joshuacurtiss
Copy link
Member Author

joshuacurtiss commented Aug 28, 2025

☝️ Rebase on main. Note the rebase would've changed the build hash from what I have in the description.

Copy link
Contributor

@akamal4 akamal4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and tested on RHELS9 VM and had no issues.

@akamal4 akamal4 merged commit 3e18309 into main Sep 1, 2025
2 checks passed
@joshuacurtiss joshuacurtiss deleted the jcurt/podman-and-ephemeral-installer branch September 1, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants