Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Commit 050b2b3

Browse files
Merge pull request #116 from DelusionalOptimist/DelusionalOptimist/build/dockerfile
[Build] move to kubeopenapi-jsonschema compatible base image
2 parents 3d45acd + c3e9a54 commit 050b2b3

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/setup-go@v1
2222
with:
2323
go-version: ${{ secrets.GO_VERSION }}
24-
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./osm/... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
24+
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./osm/... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
2525
error_check:
2626
name: Error check
2727
runs-on: ubuntu-latest
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/setup-go@v1
3535
with:
3636
go-version: ${{ secrets.GO_VERSION }}
37-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./...
37+
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./...
3838
static_check:
3939
name: Static check
4040
runs-on: ubuntu-latest
@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/setup-go@v1
4848
with:
4949
go-version: ${{ secrets.GO_VERSION }}
50-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -tags draft -checks all ./osm/... # https://staticcheck.io/docs/checks
50+
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -tags draft -checks all ./osm/... # https://staticcheck.io/docs/checks
5151
vet:
5252
name: Vet
5353
runs-on: ubuntu-latest
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/setup-go@v1
6161
with:
6262
go-version: ${{ secrets.GO_VERSION }}
63-
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
63+
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
6464
sec_check:
6565
name: Security check
6666
runs-on: ubuntu-latest
@@ -99,4 +99,4 @@ jobs:
9999
echo "current-context:" ${CURRENTCONTEXT}
100100
export KUBECONFIG="${HOME}/.kube/config"
101101
echo "environment-kubeconfig:" ${KUBECONFIG}
102-
GOPROXY=direct GOSUMDB=off GO111MODULE=on go test ./...
102+
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go test ./...

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ RUN go mod download
77
COPY main.go main.go
88
COPY internal/ internal/
99
COPY osm/ osm/
10-
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags="-w -s -X main.version=$VERSION -X main.gitsha=$GIT_COMMITSHA" -a -o meshery-osm main.go
10+
RUN GOPROXY=https://proxy.golang.org,direct CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags="-w -s -X main.version=$VERSION -X main.gitsha=$GIT_COMMITSHA" -a -o meshery-osm main.go
1111

12-
FROM gcr.io/distroless/base
12+
FROM alpine:3.14 as jsonschema-util
13+
RUN apk add --no-cache curl
14+
WORKDIR /
15+
RUN curl -LO https://github.com/layer5io/kubeopenapi-jsonschema/releases/download/v0.1.0/kubeopenapi-jsonschema
16+
17+
FROM gcr.io/distroless/nodejs:14
1318
ENV DISTRO="debian"
1419
ENV GOARCH="amd64"
1520
ENV SERVICE_ADDR="meshery-osm"
1621
ENV MESHERY_SERVER="http://meshery:9081"
1722
WORKDIR /
1823
COPY templates/ ./templates
1924
COPY --from=build-env /github.com/layer5io/meshery-osm/meshery-osm .
25+
COPY --from=jsonschema-util /kubeopenapi-jsonschema /root/.meshery/bin/kubeopenapi-jsonschema
2026
ENTRYPOINT ["/meshery-osm"]

helpers/component_info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "osm",
33
"type": "adapter",
4-
"next_error_code": 1023
5-
}
4+
"next_error_code": 1021
5+
}

0 commit comments

Comments
 (0)