Skip to content

Commit 9126920

Browse files
authored
Merge pull request #2279 from marquiz/devel/dockerfile
Dockerfile: use mount for exposing source code into the build context
2 parents 42fb100 + d85b9f6 commit 9126920

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \
1515
go mod download
1616

1717
# Do actual build
18-
COPY . /go/node-feature-discovery
19-
2018
ARG VERSION
2119
ARG HOSTMOUNT_PREFIX
2220

2321
RUN --mount=type=cache,target=/go/pkg/mod/ \
22+
--mount=src=.,target=. \
2423
make install VERSION=$VERSION HOSTMOUNT_PREFIX=$HOSTMOUNT_PREFIX
2524

2625
# Create full variant of the production image
@@ -32,7 +31,7 @@ USER 65534:65534
3231
# Use more verbose logging of gRPC
3332
ENV GRPC_GO_LOG_SEVERITY_LEVEL="INFO"
3433

35-
COPY --from=builder /go/node-feature-discovery/deployment/components/worker-config/nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
34+
COPY deployment/components/worker-config/nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
3635
COPY --from=builder /go/bin/* /usr/bin/
3736

3837
# Create minimal variant of the production image
@@ -44,5 +43,5 @@ USER 65534:65534
4443
# Use more verbose logging of gRPC
4544
ENV GRPC_GO_LOG_SEVERITY_LEVEL="INFO"
4645

47-
COPY --from=builder /go/node-feature-discovery/deployment/components/worker-config/nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
46+
COPY deployment/components/worker-config/nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
4847
COPY --from=builder /go/bin/* /usr/bin/

0 commit comments

Comments
 (0)