Skip to content

Commit 9e3954b

Browse files
committed
GOPATH handling not necessary anymore
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
1 parent 7732a5e commit 9e3954b

7 files changed

Lines changed: 9 additions & 18 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ jobs:
3737

3838
host:
3939
runs-on: ${{ matrix.os }}
40-
env:
41-
GOPATH: ${{ github.workspace }}
42-
GOBIN: ${{ github.workspace }}/bin
43-
GO111MODULE: auto
4440
strategy:
4541
fail-fast: false
4642
matrix:
@@ -57,8 +53,6 @@ jobs:
5753
-
5854
name: Checkout
5955
uses: actions/checkout@v3
60-
with:
61-
path: ${{ env.GOPATH }}/src/github.com/docker/cli
6256
-
6357
name: Set up Go
6458
uses: actions/setup-go@v4
@@ -69,11 +63,9 @@ jobs:
6963
run: |
7064
go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '/vendor/|/e2e/')
7165
go tool cover -func=/tmp/coverage.txt
72-
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
7366
shell: bash
7467
-
7568
name: Send to Codecov
7669
uses: codecov/codecov-action@v3
7770
with:
7871
file: /tmp/coverage.txt
79-
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1313
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build-base-alpine
1414
COPY --from=xx / /
1515
RUN apk add --no-cache bash clang lld llvm file git
16-
WORKDIR /go/src/github.com/docker/cli
16+
WORKDIR /src
1717

1818
FROM build-base-alpine AS build-alpine
1919
ARG TARGETPLATFORM
@@ -23,7 +23,7 @@ RUN xx-apk add --no-cache musl-dev gcc
2323
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS build-base-bullseye
2424
COPY --from=xx / /
2525
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld llvm file
26-
WORKDIR /go/src/github.com/docker/cli
26+
WORKDIR /src
2727

2828
FROM build-base-bullseye AS build-bullseye
2929
ARG TARGETPLATFORM
@@ -119,7 +119,7 @@ COPY --from=build-plugins /out ./build/
119119
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx
120120
COPY . .
121121
ENV DOCKER_BUILDKIT=1
122-
ENV PATH=/go/src/github.com/docker/cli/build:$PATH
122+
ENV PATH=/src/build:$PATH
123123
CMD ./scripts/test/e2e/entry
124124

125125
FROM build-base-${BASE_VARIANT} AS dev

docker.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
# Overridable env vars
8-
DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/go/src/github.com/docker/cli
8+
DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/src
99
DOCKER_CLI_CONTAINER_NAME ?=
1010
DOCKER_CLI_GO_BUILD_CACHE ?= y
1111

dockerfiles/Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ RUN echo -e "\nYou are now in a development container. Run '\e\033[1mmake help\e
4646
&& echo -e "cat /etc/motd\nPS1=\"\e[0;32m\u@docker-cli-dev\\$ \e[0m\"" >> /root/.bashrc
4747
CMD bash
4848
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
49-
ENV PATH=$PATH:/go/src/github.com/docker/cli/build
49+
ENV PATH=$PATH:/src/build
5050

5151
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx
5252
COPY --from=gofumpt /go/bin/* /go/bin/
5353
COPY --from=gotestsum /go/bin/* /go/bin/
5454
COPY --from=goversioninfo /go/bin/* /go/bin/
5555

56-
WORKDIR /go/src/github.com/docker/cli
56+
WORKDIR /src
5757
ENV GO111MODULE=auto
5858
COPY . .

dockerfiles/Dockerfile.lint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS lint
1010
ENV GO111MODULE=off
1111
ENV CGO_ENABLED=0
1212
ENV GOGC=75
13-
WORKDIR /go/src/github.com/docker/cli
14-
COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/golangci-lint
13+
WORKDIR /src
1514
RUN --mount=type=bind,target=. \
1615
--mount=type=cache,target=/root/.cache \
16+
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
1717
golangci-lint run

dockerfiles/Dockerfile.shellcheck

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
FROM koalaman/shellcheck-alpine:v0.7.1 AS shellcheck
4-
WORKDIR /go/src/github.com/docker/cli
4+
WORKDIR /src
55
RUN --mount=type=bind,target=. \
66
set -eo pipefail; \
77
find scripts/ contrib/completion/bash -type f | grep -v scripts/winresources | grep -v '.*.ps1' | xargs shellcheck

scripts/test/e2e/run

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ runtests() {
6666
TEST_DOCKER_CERT_PATH="${DOCKER_CERT_PATH-}" \
6767
TEST_REMOTE_DAEMON="${REMOTE_DAEMON-}" \
6868
TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \
69-
GOPATH="$GOPATH" \
7069
PATH="$PWD/build/:/usr/bin:/usr/local/bin:/usr/local/go/bin" \
7170
HOME="$HOME" \
7271
DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-amd64" \

0 commit comments

Comments
 (0)