diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7b01a49 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Phase build (I) +FROM golang:1.18-alpine AS builder +WORKDIR /app +COPY . . +RUN go build -o qsreplace main.go + +# Рhase run (II) +FROM alpine:latest +COPY --from=builder /app/qsreplace /usr/local/bin/ +RUN chmod +x /usr/local/bin/qsreplace +LABEL maintainer="localhost" +LABEL description="Containerized version of qsreplace to replace query parameters in URLs" + +# Phase entrypoint +ENTRYPOINT ["qsreplace"] diff --git a/README.mkd b/README.mkd index 608b7ae..2078126 100644 --- a/README.mkd +++ b/README.mkd @@ -23,6 +23,12 @@ https://example.com/pathtwo?one=newval&two=newval https://example.net/a/path?one=newval&two=newval ``` +### Replace Query String Values use docker + +``` +▶ cat urls.txt | docker run -i qsreplace newval +``` + ### Append to Query String Values ``` @@ -52,3 +58,9 @@ With Go: Or [download a release](https://github.com/tomnomnom/qsreplace/releases) and put it somewhere in your `$PATH` (e.g. in /usr/local/bin). + +With docker: + +``` +▶ git clone https://github.com/tomnomnom/qsreplace && docker build -t qsreplace . +```