Skip to content

Commit

Permalink
♻️ use golang:xxx-buster image as base
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <[email protected]>
  • Loading branch information
rinx committed Sep 25, 2020
1 parent ad2eeb9 commit c1e6e33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Makefile.d/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ docker/build/base:
$(DOCKER) build \
$(DOCKER_OPTS) \
-f dockers/base/Dockerfile \
-t $(REPO)/$(BASE_IMAGE) .
-t $(REPO)/$(BASE_IMAGE) . \
--build-arg GO_VERSION=$(GO_VERSION)

.PHONY: docker/name/agent-ngt
docker/name/agent-ngt:
Expand All @@ -52,6 +53,7 @@ docker/build/agent-ngt: docker/build/base
$(DOCKER_OPTS) \
-f dockers/agent/core/ngt/Dockerfile \
-t $(REPO)/$(AGENT_IMAGE):$(TAG) . \
--build-arg BASE_TAG=$(TAG) \
--build-arg DISTROLESS_IMAGE=$(DISTROLESS_IMAGE) \
--build-arg DISTROLESS_IMAGE_TAG=$(DISTROLESS_IMAGE_TAG) \
--build-arg UPX_OPTIONS=$(UPX_OPTIONS)
Expand Down
3 changes: 2 additions & 1 deletion dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# limitations under the License.
#

ARG BASE_TAG=latest
ARG DISTROLESS_IMAGE=gcr.io/distroless/static
ARG DISTROLESS_IMAGE_TAG=nonroot
ARG UPX_OPTIONS=-9

FROM vdaas/vald-base:latest AS builder
FROM vdaas/vald-base:${BASE_TAG} AS builder
ARG UPX_OPTIONS

ENV ORG vdaas
Expand Down
12 changes: 5 additions & 7 deletions dockers/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
ARG GO_VERSION

FROM golang:${GO_VERSION}-buster AS golang

FROM ubuntu:devel AS builder

Expand All @@ -36,13 +39,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt
COPY versions/GO_VERSION .
RUN export GO_VERSION="$(cat GO_VERSION)" \
&& curl -sSL -O "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" \
&& tar zxf "go${GO_VERSION}.linux-amd64.tar.gz" \
&& rm "go${GO_VERSION}.linux-amd64.tar.gz" \
&& ln -s /opt/go/bin/go /usr/bin/ \
COPY --from=golang /usr/local/go /opt/go
RUN ln -s /opt/go/bin/go /usr/bin/ \
&& mkdir $GOPATH

WORKDIR ${GOPATH}/src/github.com/vdaas/vald
Expand Down

0 comments on commit c1e6e33

Please sign in to comment.