From 818790ad8736350d7be68b2d7f0f394d6ffedfff Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki Date: Fri, 9 Feb 2024 14:33:37 +0900 Subject: [PATCH] Revert dev Dockerfile to use official devcontainer image (#2335) * Update Dockerfile to use official debian based image for devcontainer * Use debian as base * Update comment --- Makefile.d/tools.mk | 36 ++++++++++++++++++++++++++++++++++++ dockers/dev/Dockerfile | 13 ++++++++++--- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/Makefile.d/tools.mk b/Makefile.d/tools.mk index e370b08d2f..8b7d6daa6a 100644 --- a/Makefile.d/tools.mk +++ b/Makefile.d/tools.mk @@ -102,6 +102,42 @@ yamlfmt/install: $(GOPATH)/bin/yamlfmt $(GOPATH)/bin/yamlfmt: $(call go-install, github.com/google/yamlfmt/cmd/yamlfmt) +.PHONY: gopls/install +gopls/install: $(GOPATH)/bin/gopls + +$(GOPATH)/bin/gopls: + $(call go-install, golang.org/x/tools/gopls) + +.PHONY: gomodifytags/install +gomodifytags/install: $(GOPATH)/bin/gomodifytags + +$(GOPATH)/bin/gomodifytags: + $(call go-install, github.com/fatih/gomodifytags) + +.PHONY: impl/install +impl/install: $(GOPATH)/bin/impl + +$(GOPATH)/bin/impl: + $(call go-install, github.com/josharian/impl) + +.PHONY: goplay/install +goplay/install: $(GOPATH)/bin/goplay + +$(GOPATH)/bin/goplay: + $(call go-install, github.com/haya14busa/goplay/cmd/goplay) + +.PHONY: delve/install +delve/install: $(GOPATH)/bin/dlv + +$(GOPATH)/bin/dlv: + $(call go-install, github.com/go-delve/delve/cmd/dlv) + +.PHONY: staticcheck/install +staticcheck/install: $(GOPATH)/bin/staticcheck + +$(GOPATH)/bin/staticcheck: + $(call go-install, honnef.co/go/tools/cmd/staticcheck) + .PHONY: rust/install rust/install: $(CARGO_HOME)/bin/cargo diff --git a/dockers/dev/Dockerfile b/dockers/dev/Dockerfile index 30449e7ad8..4b72efdd05 100644 --- a/dockers/dev/Dockerfile +++ b/dockers/dev/Dockerfile @@ -18,7 +18,8 @@ ARG MAINTAINER="vdaas.org vald team " # skipcq: DOK-DL3026 -FROM --platform=${BUILDPLATFORM} ubuntu:devel AS builder +# we should stick to official devcontainers as a base image because it is well tested to be used with the vscode devcontainer extension. +FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/vscode/devcontainers/base:debian LABEL maintainer="${MAINTAINER}" ARG GO_VERSION @@ -71,7 +72,6 @@ COPY rust rust COPY hack/go.mod.default hack/go.mod.default COPY example/client/go.mod.default example/client/go.mod.default -# basic deps RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ --mount=type=cache,target="${HOME}/.cache/go-build",id="go-build-${TARGETARCH}" \ make GOARCH=${TARGETARCH} GOOS=${TARGETOS} deps GO_CLEAN_DEPS=false \ @@ -89,4 +89,11 @@ RUN --mount=type=cache,target="${GOPATH}/pkg",id="go-build-${TARGETARCH}" \ && make k9s/install \ && make minikube/install \ && make stern/install \ - && make telepresence/install + && make telepresence/install \ + && echo "installing golang vscode extension dependencies" \ + && make gopls/install \ + && make gotests/install \ + && make gomodifytags/install \ + && make impl/install \ + && make delve/install \ + && make staticcheck/install