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

Simplify how you run wws commands in the container #166

Closed
Angelmmiguel opened this issue Jun 30, 2023 · 2 comments · Fixed by #187
Closed

Simplify how you run wws commands in the container #166

Angelmmiguel opened this issue Jun 30, 2023 · 2 comments · Fixed by #187
Assignees
Labels
🚀 enhancement New feature or request 👋 good first issue Good for newcomers
Milestone

Comments

@Angelmmiguel
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The wws container runs the wws CLI with a set of default flags. To configure this behavior, the container uses the CMD directive:

CMD ["/wws", "/app/", "--host", "0.0.0.0"]

This solution works well when you don't want to modify or add argument. However, if you want to add a flag or run a project from a remote repository, the following command doesn't work:

docker run -p 8080:8080 ghcr.io/vmware-labs/wws:v1.3.0 \
  https://github.com/vmware-labs/wasm-workers-server.git \
    --git-folder "examples/js-basic" \
    -i --enable-panel --host 0.0.0.0

The CMD directive gets fully override and it fails because "https://github.com/vmware-labs/wasm-workers-server.git" is not a valid binary. You need to refer to the wws binary directly, which it's not in the PATH making difficult to add / remove parameters.

The following code works, but it's not trivial:

docker run -p 8080:8080 ghcr.io/vmware-labs/wws:v1.3.0 \
  /wws https://github.com/vmware-labs/wasm-workers-server.git \
    --git-folder "examples/js-basic" \
    -i --enable-panel --host 0.0.0.0

Describe the solution you'd like

I want the container to run "like a binary". The following command should work out of the box:

docker run -p 8080:8080 ghcr.io/vmware-labs/wws:v1.3.0 \
  https://github.com/vmware-labs/wasm-workers-server.git \
    --git-folder "examples/js-basic" \
    -i --enable-panel --host 0.0.0.0

These are the requirements:

  • The container always run the wws CLI. For that, we can use the ENTRYPOINT directive which fits perfectly for this use case.
  • Keep the CMD directive, but only for the default arguments (/app and --host 0.0.0.0). You can override the default values by adding arguments as showed in the previous example. There is a great example in the Docker documentation.

For convenience, the wws should be present in the PATH in case you need to update the default entrypoint. Pointing it to the binary location (/wws) is not trivial.

Describe alternatives you've considered

No response

Additional context

No response

@Angelmmiguel Angelmmiguel added 🚀 enhancement New feature or request 👋 good first issue Good for newcomers labels Jun 30, 2023
@Angelmmiguel Angelmmiguel modified the milestone: v1.4.0 Jul 5, 2023
@dierbei
Copy link
Contributor

dierbei commented Jul 25, 2023

I want to try to solve this problem.

dierbei added a commit to dierbei/wasm-workers-server that referenced this issue Jul 25, 2023
dierbei added a commit to dierbei/wasm-workers-server that referenced this issue Jul 25, 2023
@Angelmmiguel
Copy link
Contributor Author

Hello @dierbei,

That would be amazing! I assigned the issue to you. Feel free to drop any question or comment here 😄

ereslibre pushed a commit that referenced this issue Jul 25, 2023
@Angelmmiguel Angelmmiguel added this to the v1.5.0 milestone Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request 👋 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants