Skip to content

Building qsreplace in a container #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 12 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down Expand Up @@ -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 .
```