File tree Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- .PHONY : gen clean certs build
15
+ .PHONY : gen clean certs build docker/proxy-server docker/proxy-agent
16
16
proto/agent/agent.pb.go : proto/agent/agent.proto
17
17
protoc -I proto proto/agent/agent.proto --go_out=plugins=grpc:proto
18
18
@@ -32,9 +32,19 @@ proto/proxy.pb.go: proto/proxy.proto
32
32
bin/proxy-agent : bin cmd/agent/main.go proto/agent/agent.pb.go
33
33
go build -o bin/proxy-agent cmd/agent/main.go
34
34
35
+ docker/proxy-agent : cmd/agent/main.go proto/agent/agent.pb.go
36
+ @[ " ${REGISTRY} " ] || ( echo " REGISTRY is not set" ; exit 1 )
37
+ @[ " ${PROJECT_ID} " ] || ( echo " PROJECT_ID is not set" ; exit 1 )
38
+ docker build . -f artifacts/images/agent-build.Dockerfile -t ${REGISTRY} /${PROJECT_ID} /proxy-agent:latest
39
+
35
40
bin/proxy-server : bin cmd/proxy/main.go proto/agent/agent.pb.go proto/proxy.pb.go
36
41
go build -o bin/proxy-server cmd/proxy/main.go
37
42
43
+ docker/proxy-server : cmd/proxy/main.go proto/agent/agent.pb.go proto/proxy.pb.go
44
+ @[ " ${REGISTRY} " ] || ( echo " REGISTRY is not set" ; exit 1 )
45
+ @[ " ${PROJECT_ID} " ] || ( echo " PROJECT_ID is not set" ; exit 1 )
46
+ docker build . -f artifacts/images/server-build.Dockerfile -t ${REGISTRY} /${PROJECT_ID} /server-proxy:latest
47
+
38
48
bin/proxy-test-client : bin cmd/client/main.go proto/proxy.pb.go
39
49
go build -o bin/proxy-test-client cmd/client/main.go
40
50
Original file line number Diff line number Diff line change @@ -17,12 +17,27 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
17
17
18
18
## Build
19
19
20
+ Please make sure you have the REGISTRY and PROJECT_ID environment variables set.
21
+ For local builds these can be set to anything.
22
+ For image builds these determine the location of your image.
23
+ For GCE the registry should be gcr.io and PROJECT_ID should be the project you
24
+ want to use the images in.
25
+
26
+ ### Local builds
27
+
20
28
``` console
21
29
make clean
22
30
make certs
23
31
make build
24
32
```
25
33
34
+ ### Build images
35
+
36
+ ``` console
37
+ build docker/proxy-server
38
+ build docker/proxy-agent
39
+ ```
40
+
26
41
## Examples
27
42
28
43
The current examples run two actual services as well as a sample client on one end and a sample destination for
Original file line number Diff line number Diff line change
1
+ # Build the proxy-agent binary
2
+ FROM golang:1.12.1 as builder
3
+
4
+ # Copy in the go src
5
+ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
6
+ COPY pkg/ pkg/
7
+ COPY cmd/ cmd/
8
+ COPY proto/ proto/
9
+ COPY vendor/ vendor/
10
+
11
+ # Build
12
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o proxy-agent sigs.k8s.io/apiserver-network-proxy/cmd/agent
13
+
14
+ # Copy the loader into a thin image
15
+ FROM scratch
16
+ WORKDIR /
17
+ COPY --from=builder /go/src/sigs.k8s.io/apiserver-network-proxy/proxy-agent .
18
+ ENTRYPOINT ["/proxy-agent" ]
Original file line number Diff line number Diff line change
1
+ # Build the proxy-server binary
2
+ FROM golang:1.12.1 as builder
3
+
4
+ # Copy in the go src
5
+ WORKDIR /go/src/sigs.k8s.io/apiserver-network-proxy
6
+ COPY pkg/ pkg/
7
+ COPY cmd/ cmd/
8
+ COPY proto/ proto/
9
+ COPY vendor/ vendor/
10
+
11
+ # Build
12
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o proxy-server sigs.k8s.io/apiserver-network-proxy/cmd/proxy
13
+
14
+ # Copy the loader into a thin image
15
+ FROM scratch
16
+ WORKDIR /
17
+ COPY --from=builder /go/src/sigs.k8s.io/apiserver-network-proxy/proxy-server .
18
+ ENTRYPOINT ["/proxy-server" ]
You can’t perform that action at this time.
0 commit comments