Skip to content

Commit 2dca5cc

Browse files
priomansermino
authored andcommitted
added base dockerfile (#14)
Added base dockerfile, updated circleci config.
1 parent dc0de63 commit 2dca5cc

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

.circleci/config.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
version: 2
22
jobs:
33
build:
4+
working_directory: $HOME/go/src/github.com/ChainSafeSystems/go-pre
45
docker:
56
- image: circleci/golang:1.11
67

78
steps:
8-
- checkout
9+
- checkout:
10+
path: $HOME/go/src/github.com/ChainSafeSystems/go-pre
11+
- attach_workspace:
12+
at: $HOME/go/src/github.com/ChainSafeSystems/go-pre
13+
914
- run: go get -v -t -d ./...
10-
- run: go test -v ./...
15+
- run: go test -v ./...
16+
- run: gometalinter ./...
17+
18+

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM golang:1.11.5-alpine3.8 as build
2+
3+
RUN apk --no-cache add git linux-headers ca-certificates
4+
COPY . /go/src/github.com/ChainSafeSystems/go-pre
5+
WORKDIR /go/src/github.com/ChainSafeSystems/go-pre
6+
ENV GO111MODULE=off
7+
RUN go install -v ./...
8+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o go-pre .
9+
10+
11+
FROM scratch
12+
13+
WORKDIR /
14+
COPY --from=builder ./go/src/github.com/ChainSafeSystems/go-pre/go-pre .
15+
CMD ["./go-pre"]

codec/encode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func encodeInteger(i int) ([]byte, error) {
5656
o := make([]byte, 4)
5757
binary.LittleEndian.PutUint32(o, uint32(i<<2)+2)
5858
return o, nil
59-
}
59+
}
6060

6161
// TODO: this case only works for integers between 2**30 and 2**64 due to the fact that Go's integers only hold up
6262
// to 2 ** 64. need to implement this case for integers > 2**64 using the big.Int library
@@ -89,6 +89,6 @@ func encodeInteger(i int) ([]byte, error) {
8989
func encodeBool(l bool) ([]byte, error) {
9090
if l {
9191
return []byte{0x01}, nil
92-
}
92+
}
9393
return []byte{0x00}, nil
9494
}

0 commit comments

Comments
 (0)