Skip to content

Commit 5d345bd

Browse files
authored
Merge pull request #50 from IQSS/docker
run go commands in Docker
2 parents 2efdc3f + cf7f15f commit 5d345bd

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Finally, issue the following commands to download JSON files about each project
2525

2626
A file called `data.tsv` should result, representing the data you just downloaded. Again, it should look something like the tsv file described above or the one at http://dx.doi.org/10.7910/DVN/TJCLKP .
2727

28+
### Running with Docker
29+
30+
If you don't want to install Go locally, you can use [Docker](https://www.docker.com) instead:
31+
32+
make download
33+
make parse
34+
2835
If you have any trouble with the commands above or have any ideas for this project, please open a GitHub issue. Pull request are also very welcome!
2936

3037
## Keeping github.tsv sorted

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:1.23-alpine AS build-download
2+
WORKDIR /build
3+
COPY download.go .
4+
RUN go mod init osah && go build -o download .
5+
6+
FROM golang:1.23-alpine AS build-parse
7+
WORKDIR /build
8+
COPY parse.go .
9+
RUN go mod init osah && go build -o parse .
10+
11+
FROM alpine:3.20 AS download
12+
COPY --from=build-download /build/download /usr/local/bin/download
13+
WORKDIR /data
14+
ENTRYPOINT ["download"]
15+
16+
FROM alpine:3.20 AS parse
17+
COPY --from=build-parse /build/parse /usr/local/bin/parse
18+
WORKDIR /data
19+
ENTRYPOINT ["parse"]

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
download:
2+
docker build --target download -t osah-download .
3+
docker run --rm -v "$(PWD):/data" osah-download
4+
5+
parse:
6+
docker build --target parse -t osah-parse .
7+
docker run --rm -v "$(PWD):/data" osah-parse

0 commit comments

Comments
 (0)