diff options
author | Dominick Gendill <dgendill@gmail.com> | 2017-01-20 15:20:07 -0700 |
---|---|---|
committer | Dominick Gendill <dgendill@gmail.com> | 2017-01-20 15:20:07 -0700 |
commit | 105cd287d23b233b048da3b1bb12fc915216fc43 (patch) | |
tree | b40456b3acf174c844d21cc139b21ddadf1a9e6b | |
parent | f0f74b6cd1dc8f1345cc7679010a227de26268b2 (diff) | |
download | purescript-docker-105cd287d23b233b048da3b1bb12fc915216fc43.tar.gz purescript-docker-105cd287d23b233b048da3b1bb12fc915216fc43.tar.zst purescript-docker-105cd287d23b233b048da3b1bb12fc915216fc43.zip |
Added Dockerfile. Upgraded to purescript 0.10.5.
-rw-r--r-- | Dockerfile | 26 | ||||
-rw-r--r-- | README.md | 18 |
2 files changed, 37 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..88b1b8c --- /dev/null +++ b/Dockerfile | |||
@@ -0,0 +1,26 @@ | |||
1 | FROM node:4 | ||
2 | |||
3 | MAINTAINER Risto Stevcev | ||
4 | |||
5 | ENV PURESCRIPT_DOWNLOAD_SHA1 8355acb4419fcd136d7f8d19d398ae8ebf457bcd | ||
6 | |||
7 | RUN npm install -g bower pulp@10.0.0 | ||
8 | |||
9 | RUN cd /opt \ | ||
10 | && wget https://github.com/purescript/purescript/releases/download/v0.10.5/linux64.tar.gz \ | ||
11 | && echo "$PURESCRIPT_DOWNLOAD_SHA1 linux64.tar.gz" | sha1sum -c - \ | ||
12 | && tar -xvf linux64.tar.gz \ | ||
13 | && rm /opt/linux64.tar.gz | ||
14 | |||
15 | ENV PATH /opt/purescript:$PATH | ||
16 | |||
17 | RUN userdel node | ||
18 | RUN useradd -m -s /bin/bash pureuser | ||
19 | |||
20 | WORKDIR /home/pureuser | ||
21 | |||
22 | USER pureuser | ||
23 | |||
24 | RUN mkdir tmp && cd tmp && pulp init | ||
25 | |||
26 | CMD cd tmp && pulp psci | ||
@@ -7,7 +7,11 @@ Purescript build for docker | |||
7 | 7 | ||
8 | ![Purescript](https://raw.githubusercontent.com/Risto-Stevcev/purescript-docker/master/logo.png) | 8 | ![Purescript](https://raw.githubusercontent.com/Risto-Stevcev/purescript-docker/master/logo.png) |
9 | 9 | ||
10 | # usage | 10 | # Build Locally |
11 | |||
12 | You can build the image locally by cloning the repo and running `docker build .` in the project root. | ||
13 | |||
14 | # Usage | ||
11 | 15 | ||
12 | Note: You may need to run docker comands as a superuser (sudo) depending on how it's configured on your system. | 16 | Note: You may need to run docker comands as a superuser (sudo) depending on how it's configured on your system. |
13 | 17 | ||
@@ -17,7 +21,7 @@ Pull the version you want to use: | |||
17 | $ docker pull gyeh/purescript:0.9.1 | 21 | $ docker pull gyeh/purescript:0.9.1 |
18 | ``` | 22 | ``` |
19 | 23 | ||
20 | Check to see that your image was created: | 24 | Check to see that your image was created: |
21 | 25 | ||
22 | ``` | 26 | ``` |
23 | $ docker images | 27 | $ docker images |
@@ -30,9 +34,9 @@ Try the Purescript REPL (you need to run it in interactive mode with a pseudo-te | |||
30 | ``` | 34 | ``` |
31 | $ docker run --rm -it b09608732ec8 | 35 | $ docker run --rm -it b09608732ec8 |
32 | ____ ____ _ _ | 36 | ____ ____ _ _ |
33 | | _ \ _ _ _ __ ___/ ___| ___ _ __(_)_ __ | |_ | 37 | | _ \ _ _ _ __ ___/ ___| ___ _ __(_)_ __ | |_ |
34 | | |_) | | | | '__/ _ \___ \ / __| '__| | '_ \| __| | 38 | | |_) | | | | '__/ _ \___ \ / __| '__| | '_ \| __| |
35 | | __/| |_| | | | __/___) | (__| | | | |_) | |_ | 39 | | __/| |_| | | | __/___) | (__| | | | |_) | |_ |
36 | |_| \__,_|_| \___|____/ \___|_| |_| .__/ \__| | 40 | |_| \__,_|_| \___|____/ \___|_| |_| .__/ \__| |
37 | |_| | 41 | |_| |
38 | 42 | ||
@@ -44,11 +48,11 @@ $ docker run --rm -it b09608732ec8 | |||
44 | > :t "Foo" | 48 | > :t "Foo" |
45 | String | 49 | String |
46 | 50 | ||
47 | > | 51 | > |
48 | See ya! | 52 | See ya! |
49 | ``` | 53 | ``` |
50 | 54 | ||
51 | To start doing real work with it, you need to mount a volume to your docker container when you run it. | 55 | To start doing real work with it, you need to mount a volume to your docker container when you run it. |
52 | Clone the [Purescript By Example](https://leanpub.com/purescript/read) code as an initial example: | 56 | Clone the [Purescript By Example](https://leanpub.com/purescript/read) code as an initial example: |
53 | 57 | ||
54 | ``` | 58 | ``` |
@@ -85,7 +89,7 @@ Just ("Smith, John: 123 Fake St., Faketown, CA") | |||
85 | 89 | ||
86 | Since you mounted the volume, you can actually edit the code outside of the running docker instance and it will update inside the container! | 90 | Since you mounted the volume, you can actually edit the code outside of the running docker instance and it will update inside the container! |
87 | 91 | ||
88 | Open up `chapter3/test/Main.purs` using your favorite editor, and update `example.address.street` in the `example` record to `"123 Foobar St."`. Now rerun the tests, and you'll see that it updated! | 92 | Open up `chapter3/test/Main.purs` using your favorite editor, and update `example.address.street` in the `example` record to `"123 Foobar St."`. Now rerun the tests, and you'll see that it updated! |
89 | 93 | ||
90 | ``` | 94 | ``` |
91 | pureuser@1ddb0b0ed568:~/src/chapter3$ pulp test | 95 | pureuser@1ddb0b0ed568:~/src/chapter3$ pulp test |