aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRisto Stevcev <risto1@gmail.com>2017-01-21 02:18:06 +0100
committerGitHub <noreply@github.com>2017-01-21 02:18:06 +0100
commit57b1ad33d048df3b72aa62e68f011cafaaa66f84 (patch)
treeb40456b3acf174c844d21cc139b21ddadf1a9e6b
parentf0f74b6cd1dc8f1345cc7679010a227de26268b2 (diff)
parent105cd287d23b233b048da3b1bb12fc915216fc43 (diff)
downloadpurescript-docker-57b1ad33d048df3b72aa62e68f011cafaaa66f84.tar.gz
purescript-docker-57b1ad33d048df3b72aa62e68f011cafaaa66f84.tar.zst
purescript-docker-57b1ad33d048df3b72aa62e68f011cafaaa66f84.zip
Merge pull request #1 from dgendill/master0.10.5
Add Dockerfile and Upgrade to Purescript 0.10.5
-rw-r--r--Dockerfile26
-rw-r--r--README.md18
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 @@
1FROM node:4
2
3MAINTAINER Risto Stevcev
4
5ENV PURESCRIPT_DOWNLOAD_SHA1 8355acb4419fcd136d7f8d19d398ae8ebf457bcd
6
7RUN npm install -g bower pulp@10.0.0
8
9RUN 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
15ENV PATH /opt/purescript:$PATH
16
17RUN userdel node
18RUN useradd -m -s /bin/bash pureuser
19
20WORKDIR /home/pureuser
21
22USER pureuser
23
24RUN mkdir tmp && cd tmp && pulp init
25
26CMD cd tmp && pulp psci
diff --git a/README.md b/README.md
index f75320c..5f018e5 100644
--- a/README.md
+++ b/README.md
@@ -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
12You can build the image locally by cloning the repo and running `docker build .` in the project root.
13
14# Usage
11 15
12Note: You may need to run docker comands as a superuser (sudo) depending on how it's configured on your system. 16Note: 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
20Check to see that your image was created: 24Check 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"
45String 49String
46 50
47> 51>
48See ya! 52See ya!
49``` 53```
50 54
51To start doing real work with it, you need to mount a volume to your docker container when you run it. 55To start doing real work with it, you need to mount a volume to your docker container when you run it.
52Clone the [Purescript By Example](https://leanpub.com/purescript/read) code as an initial example: 56Clone 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
86Since you mounted the volume, you can actually edit the code outside of the running docker instance and it will update inside the container! 90Since 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
88Open 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! 92Open 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```
91pureuser@1ddb0b0ed568:~/src/chapter3$ pulp test 95pureuser@1ddb0b0ed568:~/src/chapter3$ pulp test