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

Provide Docker image and docker compose example #39

Open
2 tasks
AnomalRoil opened this issue Nov 14, 2022 · 6 comments
Open
2 tasks

Provide Docker image and docker compose example #39

AnomalRoil opened this issue Nov 14, 2022 · 6 comments

Comments

@AnomalRoil
Copy link
Contributor

AnomalRoil commented Nov 14, 2022

I'm happy to run experiments in my home network, but I would be happier if I could run these in a self-contained docker image without access to the rest of my computer...

My suggestion would be:

  • Provide a docker image on https://hub.docker.com/ with the minimal amount of permissions required
  • Provide an example Docker compose file showcasing how to use it (I'd expect it only requires "host" networking caps and maybe an env var for the API key)

PS: it seems https://github.com/dennis-tra/punchr/blob/main/docker-compose.yml is not doing what I'm asking here.

@AnomalRoil
Copy link
Contributor Author

Notice this would also enable "windows" support indirectly.

@dennis-tra
Copy link
Collaborator

Hi @AnomalRoil, great suggestion!

I went ahead and pushed an image of the client to: https://hub.docker.com/repository/docker/dennistra/punchr-client

I added the Dockerfile's to the docker subfolder if you want to have a look.

PS: it seems https://github.com/dennis-tra/punchr/blob/main/docker-compose.yml is not doing what I'm asking here.

Indeed, that's for the server deployment. It's quite confusing with all those different parts not properly separated. I replaced that with the one I'd use for running the client and moved the original one to the deploy subfolder.

IIRC one can somehow configure container capabilities that limits what they can do - though I've never done this before so just added a plain docker-compose file. Not sure if you were referring to a proper container capability configuration.

Also, the docker-compose containerized client currently doesn't get public addresses for me. This could be due to my current network setup and very well work for you. So, just a heads up. I'll investigate further 👍

Thanks again!

@AnomalRoil
Copy link
Contributor Author

I tried it on my machine and it doesn't even start, it seems:

$ docker compose up
[+] Running 1/1
 ⠿ Container punchr_client  Recreated 0.1s
Attaching to punchr_client
punchr_client  | exec /bin/sh: exec format error
punchr_client exited with code 1
punchr_client exited with code 1

(I didn't have any API key, maybe that's the issue?)

@dennis-tra
Copy link
Collaborator

Hi @AnomalRoil, thanks for reporting! That shouldn't be an issue. I thought of having tested it :/ could you share your docker-compose file? I'll check back tomorrow.

@AnomalRoil
Copy link
Contributor Author

@dennis-tra I took yours:

version: "3.9"
services:
  punchr:
    image: dennistra/punchr-client:latest
    container_name: punchr_client
    restart: always
    user: punchr
      #    environment:
      # More option at pkg/client/app.go
    network_mode: host

@lidel
Copy link
Member

lidel commented Nov 29, 2022

@dennis-tra is the docker image ARM only?

$ docker run --rm -it --net=host dennistra/punchr-client:latest
Unable to find image 'dennistra/punchr-client:latest' locally
latest: Pulling from dennistra/punchr-client
261da4162673: Pull complete
c1091238f9cf: Pull complete
2689c447030b: Pull complete
ef3e42633916: Pull complete
Digest: sha256:4db49cf33fa9e7b211e1c78f24a393dd6fa2c6d7dd76edc4ddca67b34869fbc7
Status: Downloaded newer image for dennistra/punchr-client:latest
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested
exec /bin/sh: exec format error

$ docker run --rm -it --net=host --platform linux/amd64 dennistra/punchr-client:latest
Unable to find image 'dennistra/punchr-client:latest' locally
latest: Pulling from dennistra/punchr-client
Digest: sha256:4db49cf33fa9e7b211e1c78f24a393dd6fa2c6d7dd76edc4ddca67b34869fbc7
Status: Image is up to date for dennistra/punchr-client:latest
WARNING: image with reference dennistra/punchr-client was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64/v8
docker: Error response from daemon: image with reference dennistra/punchr-client:latest was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64/v8.
See 'docker run --help'.

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

3 participants