Ver a proveniência

Add Dockerfile and instructions to build with Docker

master
mtardy há 4 anos
ascendente
cometimento
c9a48c02ad
3 ficheiros alterados com 27 adições e 0 eliminações
  1. +3
    -0
      .dockerignore
  2. +12
    -0
      Dockerfile
  3. +12
    -0
      README.md

+ 3
- 0
.dockerignore Ver ficheiro

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

+ 12
- 0
Dockerfile Ver ficheiro

@ -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 Ver ficheiro

@ -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

Carregando…
Cancelar
Guardar