File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ IMAGE:=$(REGISTRY)/node-problem-detector:$(TAG)
46
46
47
47
# ENABLE_JOURNALD enables build journald support or not. Building journald support needs libsystemd-dev
48
48
# or libsystemd-journal-dev.
49
- # TODO(random-liu): Build NPD inside container.
50
49
ENABLE_JOURNALD? =1
51
50
52
51
# TODO(random-liu): Support different architectures.
@@ -93,7 +92,9 @@ Dockerfile: Dockerfile.in
93
92
test : vet fmt
94
93
go test -timeout=1m -v -race ./cmd/options ./pkg/... $(BUILD_TAGS )
95
94
96
- build-container : ./bin/node-problem-detector ./bin/log-counter Dockerfile
95
+ build-binaries : ./bin/node-problem-detector ./bin/log-counter
96
+
97
+ build-container : build-binaries Dockerfile
97
98
docker build -t $(IMAGE ) .
98
99
99
100
build-tar : ./bin/node-problem-detector ./bin/log-counter
@@ -103,6 +104,12 @@ build-tar: ./bin/node-problem-detector ./bin/log-counter
103
104
104
105
build : build-container build-tar
105
106
107
+ docker-builder :
108
+ docker build -t npd-builder ./builder
109
+
110
+ build-in-docker : clean docker-builder
111
+ docker run -v ` pwd` :/gopath/src/k8s.io/node-problem-detector/ npd-builder:latest bash -c ' cd /gopath/src/k8s.io/node-problem-detector/ && make build-binaries'
112
+
106
113
push-container : build-container
107
114
gcloud docker -- push $(IMAGE )
108
115
Original file line number Diff line number Diff line change
1
+ # Copyright 2017 The Kubernetes Authors. All rights reserved
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ FROM golang:1.10.2
16
+ LABEL maintainer=
"Marcin Wielgus <[email protected] >"
17
+
18
+ ENV GOPATH /gopath/
19
+ ENV PATH $GOPATH/bin:$PATH
20
+
21
+ RUN apt-get update && apt-get --yes install libsystemd-dev
22
+ RUN go version
23
+ RUN go get github.com/tools/godep
24
+ RUN godep version
25
+ CMD ["/bin/bash" ]
You can’t perform that action at this time.
0 commit comments