mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
devcontainer: Use a separate devcontainer target
Use a separate `devcontainer` Dockerfile target, this allows to include the `gopls` in the devcontainer so it doesn't have to be installed by the Go vscode extension. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -251,6 +251,12 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
GOBIN=/build/ GO111MODULE=on go install "mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}" \
|
||||
&& /build/shfmt --version
|
||||
|
||||
FROM base AS gopls
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||
--mount=type=cache,target=/go/pkg/mod \
|
||||
GOBIN=/build/ GO111MODULE=on go install "golang.org/x/tools/gopls@latest" \
|
||||
&& /build/gopls version
|
||||
|
||||
FROM base AS dockercli
|
||||
WORKDIR /go/src/github.com/docker/cli
|
||||
ARG DOCKERCLI_REPOSITORY
|
||||
@@ -655,6 +661,11 @@ RUN <<EOT
|
||||
docker-proxy --version
|
||||
EOT
|
||||
|
||||
# devcontainer is a stage used by .devcontainer/devcontainer.json
|
||||
FROM dev-base AS devcontainer
|
||||
COPY --link . .
|
||||
COPY --link --from=gopls /build/ /usr/local/bin/
|
||||
|
||||
# usage:
|
||||
# > make shell
|
||||
# > SYSTEMD=true make shell
|
||||
|
||||
Reference in New Issue
Block a user