1
0
mirror of https://github.com/ericchiang/pup synced 2025-01-28 08:31:26 +00:00

Add Dockerfile

This commit is contained in:
Tobias Gesellchen 2020-02-03 21:51:58 +01:00
parent 681d7bb639
commit 30287da158
3 changed files with 37 additions and 2 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
dist/
testpages/*
tests/test_results.txt
robots.html

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM alpine:3.10 AS builder
LABEL builder=true
ENV CGO_ENABLED=0
ENV GOPATH /go
RUN apk add --update -t build-deps go git mercurial libc-dev gcc libgcc
RUN go get github.com/ericchiang/pup \
&& cd $GOPATH/src/github.com/ericchiang/pup \
&& go build \
-a \
-ldflags '-s -w -extldflags "-static"' \
-o /bin/pup
RUN adduser -DH user
FROM scratch
ENTRYPOINT [ "/pup" ]
CMD [ "--help" ]
COPY --from=builder /etc/passwd /etc/passwd
USER user
COPY --from=builder /bin/pup /pup

View File

@ -11,14 +11,21 @@ fast and flexible way of exploring HTML from the terminal.
Direct downloads are available through the [releases page](https://github.com/EricChiang/pup/releases/latest).
If you have Go installed on your computer just run `go get`.
If you have Go installed on your computer just run `go get`:
go get github.com/ericchiang/pup
If you're on OS X, use [Homebrew](http://brew.sh/) to install (no Go required).
If you're on OS X, use [Homebrew](http://brew.sh/) to install (no Go required):
brew install https://raw.githubusercontent.com/EricChiang/pup/master/pup.rb
If you have Docker installed, use the Docker image:
docker run --rm pup --help
# an alias makes it even shorter
alias pup="docker run --rm pup"
## Quick start
```bash