Skip to content

Commit 9ad0e09

Browse files
authored
chore(build): Update ndm dockerfiles to use ndm build base image (#655)
- update ndm dockerfiles to use ndm build base image - update seachest cgo build CFLAGS - remove redundant dependencies from ndm dockerfiles. The ndm build base image is shipped with the packages make and git. Signed-off-by: Aditya Jain <aditya.jainadityajain.jain@gmail.com>
1 parent 669c5f6 commit 9ad0e09

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

Makefile.buildx.mk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ docker.buildx:
6161
@echo "--> Build docker image: $(DOCKERX_IMAGE_NAME)"
6262
@echo
6363

64+
# Install dependencies if NODEPINSTALL arg not passed during invocation
65+
ifndef NODEPINSTALL
66+
buildx.ndm buildx.ndo buildx.exporter: install-dep-nonsudo
67+
endif
68+
6469
.PHONY: buildx.ndm
65-
buildx.ndm: bootstrap install-dep-nonsudo clean build.common
70+
buildx.ndm: bootstrap clean build.common
6671
@echo '--> Building node-disk-manager binary...'
6772
@pwd
6873
@CTLNAME=${NODE_DISK_MANAGER} BUILDPATH=${BUILD_PATH_NDM} BUILDX=true sh -c "'$(PWD)/build/build.sh'"
@@ -75,7 +80,7 @@ docker.buildx.ndm: COMPONENT=ndm-daemonset
7580
docker.buildx.ndm: docker.buildx
7681

7782
.PHONY: buildx.ndo
78-
buildx.ndo: bootstrap install-dep-nonsudo clean build.common
83+
buildx.ndo: bootstrap clean build.common
7984
@echo '--> Building node-disk-operator binary...'
8085
@pwd
8186
@CTLNAME=${NODE_DISK_OPERATOR} BUILDPATH=${BUILD_PATH_NDO} BUILDX=true sh -c "'$(PWD)/build/build.sh'"
@@ -88,7 +93,7 @@ docker.buildx.ndo: COMPONENT=ndm-operator
8893
docker.buildx.ndo: docker.buildx
8994

9095
.PHONY: buildx.exporter
91-
buildx.exporter: bootstrap install-dep-nonsudo clean build.common
96+
buildx.exporter: bootstrap clean build.common
9297
@echo '--> Building node-disk-exporter binary...'
9398
@pwd
9499
@CTLNAME=${NODE_DISK_EXPORTER} BUILDPATH=${BUILD_PATH_EXPORTER} BUILDX=true sh -c "'$(PWD)/build/build.sh'"

build/ndm-daemonset/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# This Dockerfile builds node-disk-manager daemon
1616
#
17-
FROM golang:1.14.7 as build
17+
FROM ghcr.io/openebs/ndm-build-base:20211202 as build
1818

1919
ARG TARGETOS
2020
ARG TARGETARCH
@@ -31,12 +31,9 @@ ENV GO111MODULE=on \
3131
RELEASE_TAG=${RELEASE_TAG}
3232

3333
WORKDIR /go/src/github.com/openebs/node-disk-manager/
34-
35-
RUN apt-get update && apt-get install -y make git
36-
3734
COPY . .
3835

39-
RUN make buildx.ndm
36+
RUN make NODEPINSTALL=true buildx.ndm
4037

4138
FROM ubuntu
4239

build/ndm-exporter/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# This Dockerfile builds ndm exporter
1616
#
17-
FROM golang:1.14.7 as build
17+
FROM ghcr.io/openebs/ndm-build-base:20211202 as build
1818

1919
ARG TARGETOS
2020
ARG TARGETARCH
@@ -31,12 +31,9 @@ ENV GO111MODULE=on \
3131
RELEASE_TAG=${RELEASE_TAG}
3232

3333
WORKDIR /go/src/github.com/openebs/node-disk-manager/
34-
35-
RUN apt-get update && apt-get install -y make git
36-
3734
COPY . .
3835

39-
RUN make buildx.exporter
36+
RUN make NODEPINSTALL=true buildx.exporter
4037

4138
FROM ubuntu
4239

build/ndm-operator/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# This Dockerfile builds ndm operator
1616
#
17-
FROM golang:1.14.7 as build
17+
FROM ghcr.io/openebs/ndm-build-base:20211202 as build
1818

1919
ARG TARGETOS
2020
ARG TARGETARCH
@@ -31,12 +31,9 @@ ENV GO111MODULE=on \
3131
RELEASE_TAG=${RELEASE_TAG}
3232

3333
WORKDIR /go/src/github.com/openebs/node-disk-manager/
34-
35-
RUN apt-get update && apt-get install -y make git
36-
3734
COPY . .
3835

39-
RUN make buildx.ndo
36+
RUN make NODEPINSTALL=true buildx.ndo
4037

4138
FROM ubuntu
4239

pkg/seachest/seachest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package seachest
1717

1818
/*
1919
#cgo LDFLAGS: -lopensea-operations -lopensea-transport -lopensea-common -lm
20+
#cgo CFLAGS: -I/usr/local/include/openSeaChest -I/usr/local/include/openSeaChest/opensea-common -I/usr/local/include/openSeaChest/opensea-operations -I/usr/local/include/openSeaChest/opensea-transport
2021
#cgo CFLAGS: -I../../../openSeaChest/include -I../../../openSeaChest/opensea-common/include -I../../../openSeaChest/opensea-operations/include -I../../../openSeaChest/opensea-transport/include
2122
#include "common.h"
2223
#include "openseachest_util_options.h"

0 commit comments

Comments
 (0)