1+ # Build gotap from source, then discard Go
2+ FROM golang:1.25-alpine AS gotap-builder
3+ RUN apk add --no-cache git
4+ ARG GOTAP_VERSION=main
5+ RUN git clone --depth 1 --branch ${GOTAP_VERSION} https://github.com/tool-spec/gotap.git /gotap && \
6+ cd /gotap && go build -o gotap .
7+
18# Pull any base image that includes python3
29FROM python:3.12
3-
4- # install the toolbox runner tools
5- RUN pip install "json2args[data]>=0.6.2"
6-
7- # if you do not need data-preloading as your tool does that on its own
8- # you can use this instread of the line above to use a json2args version
9- # with less dependencies
10- # RUN pip install json2args>=0.6.2
11-
12- # Build spec binary from source
13- RUN apt-get update && apt-get install -y golang-go git && \
14- git clone https://github.com/hydrocode-de/gotap.git /tmp/gotap && \
15- cd /tmp/gotap && go build -o /usr/local/bin/spec ./main.go && \
16- rm -rf /tmp/gotap && \
17- apt-get remove -y golang-go git && apt-get autoremove -y && apt-get clean
10+ COPY --from=gotap-builder /gotap/gotap /usr/local/bin/gotap
11+ RUN chmod +x /usr/local/bin/gotap
1812
1913# Do anything you need to install tool dependencies here
2014RUN echo "Replace this line with a tool"
@@ -26,8 +20,12 @@ RUN mkdir /out
2620RUN mkdir /src
2721COPY ./src /src
2822
23+ # Generate parameter bindings from tool.yml at build time (replaces json2args)
24+ WORKDIR /src
25+ RUN gotap generate --spec-file=tool.yml --target=python --output=parameters.py
26+
2927# copy the citation file - looks funny to make COPY not fail if the file is not there
3028COPY ./CITATION.cf[f] /src/CITATION.cff
3129
3230WORKDIR /src
33- CMD ["spec " , "run" , "foobar" , "--input-file" , "/in/input.json" ]
31+ CMD ["gotap " , "run" , "foobar" , "--input-file" , "/in/input.json" ]
0 commit comments