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

alternative Docker installation #7

Open
dmd opened this issue Dec 20, 2024 · 7 comments
Open

alternative Docker installation #7

dmd opened this issue Dec 20, 2024 · 7 comments

Comments

@dmd
Copy link

dmd commented Dec 20, 2024

If you would push a Docker image for the client, that would be another easy way for some people to play. You can have Github build a multiarch image for you.

Dockerfile is just:

FROM python:3.13
RUN python -m pip install --upgrade pip
RUN python -m pip install --upgrade pipx
RUN pipx install battleship-tui[client]
CMD ["/root/.local/bin/battleship"]

to run: docker run -ti -v ~/.cache/battleship:/root/.cache/battleship battleship

@Klavionik
Copy link
Owner

This is an interesting idea, never thought about it! I'll consider it, but I don't think it's a priority for now. There are still a lot of features to implement and improve.

@dmd
Copy link
Author

dmd commented Dec 22, 2024

For anyone who'd like to use Docker I've built one at dmd3eorg/battleship.

Right now it's arm only, I'll get the x86 one up in a day or three.

To run: docker run -ti -v ~/.cache/battleship:/root/.cache/battleship dmd3eorg/battleship

@Klavionik
Copy link
Owner

Klavionik commented Dec 24, 2024

Nice one! I tried running it and noticed, that the game looks a bit... funny. :) I believe you have to run it with COLORTERM=truecolor environment variable set to fix the colors. I would also recommend updating the package in the image to the newest version. Right now it has version 0.10.0 installed, and the latest version is 0.24.1.

@dmd
Copy link
Author

dmd commented Dec 24, 2024

That is the version pip and pipx retrieve!

root@021aa9533328:/# pipx install battleship-tui[client]
  installed package battleship-tui 0.10.0, installed using Python 3.13.1
  These apps are now globally available
    - battleship
⚠️  Note: '/root/.local/bin' is not on your PATH environment variable. These
    apps will not be globally accessible until your PATH is updated. Run
    `pipx ensurepath` to automatically add it, or manually modify your PATH
    in your shell's config file (e.g. ~/.bashrc).
done! ✨ 🌟 ✨
root@021aa9533328:/#

@dmd
Copy link
Author

dmd commented Dec 24, 2024

Weird - pipx under python 3.13 pulls 0.10, under 3.12 pulls 0.24.1.

@dmd
Copy link
Author

dmd commented Dec 24, 2024

Ok, updated. The new Dockerfile is

FROM python:3.12
RUN python -m pip install --upgrade pip
RUN python -m pip install --upgrade pipx
RUN pipx install battleship-tui[client]
ENV COLORTERM=truecolor
CMD ["/root/.local/bin/battleship"]

and I've pushed it to dmd3eorg/battleship

@Klavionik
Copy link
Owner

Yes, this is due to the Python version constraint. 😕 I didn't update it after 3.13 was released. And some earlier versions were built for ^3.10 (which explains 0.10.0 being available on PyPI). Thanks for bringing it out. Going to fix it soon (tomorrow I hope).

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