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 "init" parameter #110

Open
misery opened this issue Oct 13, 2024 · 3 comments
Open

Add "init" parameter #110

misery opened this issue Oct 13, 2024 · 3 comments

Comments

@misery
Copy link

misery commented Oct 13, 2024

Thank you very much for this tool. I really like it and use it in a docker container.

As it is a lot easier to use a vanilla container instead of a custom Dockerfile it would help if you add a parameter like -init. So it could be used to add additional packages or something like this.

See my example here that adds a /apk path and -init apk to call it once shell2http was started.

services:
  shell:
    image: msoap/shell2http
    container_name: shell2http
    command: >
        -include-stderr -500 -init apk
        /openssl "openssl s_client -connect dummyhost:443 -status"
        /apk "apk add -U openssl"
@msoap
Copy link
Owner

msoap commented Oct 13, 2024

hi @misery, sorry, don't quite understand what exactly the command -init does, just run shell command once on start?

i think it's better to do it separately, for example in own Docker image. because i want to keep tool as simple as possible

anyway, msoap/shell2http - it's a not vanilla container, it's more like example of docker image.

@misery
Copy link
Author

misery commented Oct 15, 2024

Well, most people uses docker images "as-is" and don't want to customize it with a separate docker images since it is much more easier to just deploy the image and add flags like environment variables or something like this to the configuration in portainer, rancher or even synology docker.

So a "setup" function would help a lot here.

@msoap
Copy link
Owner

msoap commented Oct 15, 2024

there is one solution: you can use entrypoint in docker compose, and override default binary by own shell script like:

entrypoint: >
    apk install ...
    some init shell command
    another command
    /app/shell2http -include-stderr -500 -init apk /openssl "openssl s_client -connect dummyhost:443 -status" ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants