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

Add ENTRYPOINT and CMD #108

Merged
merged 3 commits into from
Sep 14, 2023
Merged

Add ENTRYPOINT and CMD #108

merged 3 commits into from
Sep 14, 2023

Conversation

mshriver
Copy link
Contributor

@mshriver mshriver commented Sep 12, 2023

Have the container run like an executable, with CLI options overriding the --help command.

Build Layers

STEP 15/16: ENTRYPOINT ["swach"]
--> Using cache b9a32b37f253bff377b20eb3a3e0bbd5d758bbeed83e4d007eebe2a5c9d6dfe7
--> b9a32b37f253
STEP 16/16: CMD ["--help"]
--> Using cache 76aa005c89d9becefcb0a74cffd916b9b8c624902511c1051d5fc4620e797dbd
COMMIT local-cloudwash
--> 76aa005c89d9
Successfully tagged localhost/local-cloudwash:latest
76aa005c89d9becefcb0a74cffd916b9b8c624902511c1051d5fc4620e797dbd

Default Entry

(.cloudwash_venv) ➜  cloudwash git:(add-entrypoint) podman run localhost/local-cloudwash             
Usage: swach [OPTIONS] COMMAND [ARGS]...

  A Cleanup Utility to remove the VMs, Discs and Nics from Providers!

Options:
  --version  Get installed version of cloudwash in system
  -d, --dry  Only show what will be removed from Providers!
  --help     Show this message and exit.

Commands:
  aws        Cleanup Amazon provider
  azure      Cleanup Azure provider
  gce        Cleanup GCE provider
  openstack  Cleanup OSP provider
  rhev       Cleanup RHEV provider
  vmware     Cleanup VMWare provider

CMD override

(.cloudwash_venv) ➜  cloudwash git:(add-entrypoint) podman run localhost/local-cloudwash --version
Version: 0.0.0
Settings File: /opt/app-root/src/cloudwash/settings.yaml

Specify swach as ENTRYPOINT so container runs like executable
specify CMD to provide default argument that can be overridden
@mshriver mshriver requested a review from jyejare September 12, 2023 15:48
@mshriver mshriver added the RFE New Feature Request label Sep 12, 2023
@mshriver mshriver requested a review from ogajduse September 12, 2023 18:16
@ogajduse ogajduse merged commit ca838d8 into RedHatQE:master Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFE New Feature Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants