瀏覽代碼

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 $ 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 ## Usage
```bash ```bash
$ echo "a=2+3 a*2" | ./calc $ echo "a=2+3 a*2" | ./calc
``` ```
or
```bash
$ ./calc < file
```
## Tests ## Tests

Loading…
取消
儲存