Skip to content

Commit

Permalink
feat: ensure docker image has pwinit preloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Mar 11, 2020
1 parent 1472d6f commit 2ef46f9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Dockerfile
.dockerignore
.gitignore
node_modules
web/node_modules
out/
package-lock.json
test/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ gen.sum.tmp
go/cmd/pathwar/pathwar
tool/screenshoter/screenshoter
*_oauth_token.json
packrd/
*-packr.go
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# builder
FROM golang:1.14-alpine as builder
RUN apk --no-cache --update add nodejs-npm make gcc g++ musl-dev openssl-dev git
RUN apk --no-cache --update add nodejs-npm make gcc g++ musl-dev openssl-dev git perl-utils
RUN go get github.com/gobuffalo/packr/v2/packr2
ENV GO111MODULE=on GOPROXY=https://proxy.golang.org,direct
COPY go.mod go.sum /go/src/pathwar.land/
WORKDIR /go/src/pathwar.land/go
WORKDIR /go/src/pathwar.land
RUN go mod download
COPY . .
RUN wget -O ../rules.mk https://raw.githubusercontent.com/moul/rules.mk/master/rules.mk
WORKDIR /go/src/pathwar.land/go
RUN make packr
RUN make install

# runtime
Expand Down
6 changes: 5 additions & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ mysql.shell:
mysql.dump:
mysqldump $(MYSQL_CONFIG) pathwar

.PHONY: packr
packr:
cd pkg/pwinit && packr2

##
## generate
##
Expand Down Expand Up @@ -105,4 +109,4 @@ generate_local:

.PHONY: clean
clean:
rm -f gen.sum $(wildcard */*/*.pb.go */*/*.pb.gw.go) $(wildcard out/*)
rm -f gen.sum $(wildcard */*/*.pb.go */*/*.pb.gw.go) $(wildcard out/*) $(wildcard */*/packrd/*) $(wildcard */*/*-packr.go)
2 changes: 1 addition & 1 deletion go/gen.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ef46f9

Please sign in to comment.