ソースを参照

Add Dockerfile and instructions to build with Docker

pull/5/head
mtardy 4年前
コミット
c9a48c02ad
3個のファイルの変更27行の追加0行の削除
  1. +3
    -0
      .dockerignore
  2. +12
    -0
      Dockerfile
  3. +12
    -0
      README.md

+ 3
- 0
.dockerignore ファイルの表示

@ -0,0 +1,3 @@
.vscode/
.calc.dSYM/
.DS_Store

+ 12
- 0
Dockerfile ファイルの表示

@ -0,0 +1,12 @@
FROM alpine:3.12
# install gcc, make, libc and the bdw gc
RUN apk add --no-cache gcc make libc-dev gc-dev
# install leg
RUN wget -qO- https://www.piumarta.com/software/peg/peg-0.1.18.tar.gz | tar xz \
&& make -C /peg-0.1.18 leg >/dev/null 2>&1 \
&& mv /peg-0.1.18/leg /usr/bin/ \
&& rm -r peg-0.1.18
# Add project files and compile
WORKDIR /javascrypt
COPY . .
RUN make

+ 12
- 0
README.md ファイルの表示

@ -18,11 +18,23 @@ $ brew install bdw-gc
$ make
```
## Docker
The Docker image provides a ready to go environment to experiment with the project. Just build the image locally and run an interactive shell inside the container:
```bash
$ docker build . --tag mtardy/javascrypt
$ docker run -it mtardy/javascrypt
```
## Usage
```bash
$ echo "a=2+3 a*2" | ./calc
```
or
```bash
$ ./calc < file
```
## Tests

読み込み中…
キャンセル
保存