Skip to content

Commit ca7c883

Browse files
authored
Merge pull request #29 from FreedomBen/add-dockerfile
Create Dockerfile for shipping as docker image
2 parents b0934ca + bd4d6f0 commit ca7c883

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM alpine:3.6
2+
3+
RUN apk update \
4+
&& apk add \
5+
tini \
6+
git \
7+
make \
8+
g++ \
9+
ncurses \
10+
ncurses-dev \
11+
&& ln -s /usr/include/curses.h /usr/include/cursesw.h
12+
13+
ADD . /root/pacvim
14+
RUN cd /root/pacvim \
15+
&& make install \
16+
&& rm -rf /root/pacvim
17+
18+
RUN addgroup -g 1000 docker \
19+
&& adduser -u 1000 -G docker -s /bin/sh -D docker
20+
21+
USER docker
22+
23+
ENTRYPOINT ["/sbin/tini", "/usr/local/bin/pacvim"]

README.md

+24-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You must move pacman (the green cursor) to highlight each word on the gameboard
99
Vim is a great tool to write and edit code, but many
1010
people, including me, struggled with the steep learning curve.
1111
I did not find a fun, free way to learn about the vim commands
12-
in-depth, and thus, PacVim was born. Inspired by the the classic,
12+
in-depth, and thus, PacVim was born. Inspired by the classic,
1313
PacMan, <b>PacVim</b> is a game that'll give anyone plenty of
1414
practice with the vim commands while being a ton of fun to play.
1515

@@ -38,10 +38,31 @@ Download and build the game with:
3838
4. [sudo] make install
3939
```
4040

41+
## Using Docker
42+
43+
If you have docker installed already, you can just:
44+
45+
```sh
46+
docker run -it freedomben/pacvim [LEVEL_NUMBER] [MODE]
47+
```
48+
49+
### Building the docker image from source
50+
51+
From the project root, build the image:
52+
53+
```sh
54+
docker build -t freedomben/pacvim .
55+
```
56+
57+
Push to docker hub:
58+
59+
```sh
60+
docker push freedomben/pacvim
61+
```
4162

4263
To play, run (from anywhere):
4364
```
44-
$ pacvim [LEVEL_NUMER] [MODE]
65+
$ pacvim [LEVEL_NUMBER] [MODE]
4566
```
4667
You may specify the starting level and mode (`n` and `h` for normal/hard). Default mode is hard:
4768
```
@@ -51,7 +72,7 @@ $ pacvim 8 n
5172
To Uninstall, navigate to the folder where you cloned this repo, and type `make uninstall` <br>
5273
Note: this game may not install/compile properly without gcc version 4.8.X or higher
5374

54-
#How To Play
75+
# How To Play
5576

5677
The objective of PacVim is very similar to PacMan.
5778
You must run over all the characters on the screen while avoiding the ghosts (red `G`).

0 commit comments

Comments
 (0)