use /usr/src/moby instead, and no GOPATH

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn committed 2026-07-02 15:13:19 +02:00
1 parent 4b7a7687a5
commit ffd43fa27a
12 files changed
+44 -45

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@
"dockerfile": "../Dockerfile", "dockerfile": "../Dockerfile",
"target": "devcontainer" "target": "devcontainer"
}, },
"workspaceFolder": "/go/src/github.com/moby/moby/v2", "workspaceFolder": "/usr/src/moby",
"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/moby/moby/v2,type=bind,consistency=cached", "workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind,consistency=cached",
"remoteUser": "root", "remoteUser": "root",
"runArgs": ["--privileged"], "runArgs": ["--privileged"],
+14 -14
View File
@@ -46,13 +46,13 @@ jobs:
BIN_OUT: ${{ github.workspace }}\out BIN_OUT: ${{ github.workspace }}\out
defaults: defaults:
run: run:
working-directory: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 working-directory: /usr/src/moby
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with: with:
path: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 path: /usr/src/moby
- -
name: Env name: Env
run: | run: |
@@ -112,9 +112,9 @@ jobs:
name: Copy artifacts name: Copy artifacts
run: | run: |
New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}" New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}"
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\moby\moby\v2\bundles\docker.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\usr\src\moby\bundles\docker.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\moby\moby\v2\bundles\dockerd.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\usr\src\moby\bundles\dockerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\moby\moby\v2\bundles\docker-buildx.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\usr\src\moby\bundles\docker-buildx.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\
@@ -136,13 +136,13 @@ jobs:
GOBIN: ${{ github.workspace }}\go\bin GOBIN: ${{ github.workspace }}\go\bin
defaults: defaults:
run: run:
working-directory: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 working-directory: /usr/src/moby
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with: with:
path: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 path: /usr/src/moby
- -
name: Env name: Env
run: | run: |
@@ -198,14 +198,14 @@ jobs:
name: Test name: Test
run: | run: |
& docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" ` & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
-v "${{ env.GOPATH }}\src\github.com\moby\moby\v2\bundles:C:\gopath\src\github.com\moby\moby\v2\bundles" ` -v "C:\usr\src\moby\bundles:C:\usr\src\moby\bundles" `
${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit ${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
- -
name: Send to Codecov name: Send to Codecov
if: inputs.send_coverage if: inputs.send_coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2 uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with: with:
working-directory: ${{ env.GOPATH }}\src\github.com\moby\moby\v2 working-directory: C:\usr\src\moby\
directory: bundles directory: bundles
env_vars: RUNNER_OS env_vars: RUNNER_OS
flags: unit flags: unit
@@ -216,7 +216,7 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with: with:
name: ${{ inputs.os }}-${{ inputs.storage }}-unit-reports name: ${{ inputs.os }}-${{ inputs.storage }}-unit-reports
path: ${{ env.GOPATH }}\src\github.com\moby\moby\v2\bundles\* path: C:\usr\src\moby\bundles\*
retention-days: 1 retention-days: 1
unit-test-report: unit-test-report:
@@ -306,13 +306,13 @@ jobs:
BIN_OUT: ${{ github.workspace }}\out BIN_OUT: ${{ github.workspace }}\out
defaults: defaults:
run: run:
working-directory: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 working-directory: /usr/src/moby
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with: with:
path: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 path: /usr/src/moby
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
@@ -511,7 +511,7 @@ jobs:
if: inputs.send_coverage if: inputs.send_coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2 uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with: with:
working-directory: ${{ env.GOPATH }}\src\github.com\moby\moby\v2 working-directory: C:\usr\src\moby\
directory: bundles directory: bundles
env_vars: RUNNER_OS env_vars: RUNNER_OS
flags: integration,${{ matrix.runtime }} flags: integration,${{ matrix.runtime }}
@@ -555,7 +555,7 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with: with:
name: ${{ inputs.os }}-${{ inputs.storage }}-integration-reports-${{ matrix.runtime }}-${{ env.TESTREPORTS_NAME }} name: ${{ inputs.os }}-${{ inputs.storage }}-integration-reports-${{ matrix.runtime }}-${{ env.TESTREPORTS_NAME }}
path: ${{ env.GOPATH }}\src\github.com\moby\moby\v2\bundles\* path: C:\usr\src\moby\bundles\*
retention-days: 1 retention-days: 1
integration-test-report: integration-test-report:
+4 -4
View File
@@ -180,12 +180,12 @@ jobs:
TEST_CTN_NAME: moby TEST_CTN_NAME: moby
defaults: defaults:
run: run:
working-directory: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 working-directory: /usr/src/moby
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with: with:
path: ${{ env.GOPATH }}/src/github.com/moby/moby/v2 path: /usr/src/moby
- name: Env - name: Env
run: | run: |
@@ -252,8 +252,8 @@ jobs:
- name: Copy artifacts - name: Copy artifacts
run: | run: |
New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}" New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}"
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\moby\moby\v2\bundles\docker.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\usr\src\moby\bundles\docker.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\moby\moby\v2\bundles\dockerd.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\usr\src\moby\bundles\dockerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\
docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\ docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\
+4 -4
View File
@@ -440,7 +440,7 @@ ENV PATH=/usr/local/cli:$PATH
ENV TEST_CLIENT_BINARY=/usr/local/cli-integration/docker ENV TEST_CLIENT_BINARY=/usr/local/cli-integration/docker
ENV CONTAINERD_ADDRESS=/run/docker/containerd/containerd.sock ENV CONTAINERD_ADDRESS=/run/docker/containerd/containerd.sock
ENV CONTAINERD_NAMESPACE=moby ENV CONTAINERD_NAMESPACE=moby
WORKDIR /go/src/github.com/moby/moby/v2 WORKDIR /usr/src/moby
VOLUME /var/lib/docker VOLUME /var/lib/docker
VOLUME /home/unprivilegeduser/.local/share/docker VOLUME /home/unprivilegeduser/.local/share/docker
# Wrap all commands in the "docker-in-docker" script to allow nested containers # Wrap all commands in the "docker-in-docker" script to allow nested containers
@@ -470,13 +470,13 @@ RUN useradd --create-home --gid docker unprivilegeduser \
&& mkdir -p /home/unprivilegeduser/.local/share/docker \ && mkdir -p /home/unprivilegeduser/.local/share/docker \
&& chown -R unprivilegeduser /home/unprivilegeduser && chown -R unprivilegeduser /home/unprivilegeduser
# Let us use a .bashrc file # Let us use a .bashrc file
RUN ln -sfv /go/src/github.com/moby/moby/v2/.bashrc ~/.bashrc RUN ln -sfv /usr/src/moby/.bashrc ~/.bashrc
# Activate bash completion # Activate bash completion
RUN echo "source /usr/share/bash-completion/bash_completion" >> /etc/bash.bashrc RUN echo "source /usr/share/bash-completion/bash_completion" >> /etc/bash.bashrc
RUN ldconfig RUN ldconfig
# Set dev environment as safe git directory to prevent "dubious ownership" errors # Set dev environment as safe git directory to prevent "dubious ownership" errors
# when bind-mounting the source into the dev-container. See https://github.com/moby/moby/pull/44930 # when bind-mounting the source into the dev-container. See https://github.com/moby/moby/pull/44930
RUN git config --global --add safe.directory $GOPATH/src/github.com/moby/moby/v2 RUN git config --global --add safe.directory /usr/src/moby
# This should only install packages that are specifically needed for the dev environment and nothing else # This should only install packages that are specifically needed for the dev environment and nothing else
# Do you really need to add another package here? Can it be done in a different build stage? # Do you really need to add another package here? Can it be done in a different build stage?
RUN --mount=type=cache,sharing=locked,id=moby-dev-aptlib,target=/var/lib/apt \ RUN --mount=type=cache,sharing=locked,id=moby-dev-aptlib,target=/var/lib/apt \
@@ -526,7 +526,7 @@ COPY --link --from=dockercli-integration /build/ /usr/local/cli-integration
FROM base AS build FROM base AS build
COPY --from=gowinres /build/ /usr/local/bin/ COPY --from=gowinres /build/ /usr/local/bin/
WORKDIR /go/src/github.com/moby/moby/v2 WORKDIR /usr/src/moby
ENV CGO_ENABLED=1 ENV CGO_ENABLED=1
RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \ RUN --mount=type=cache,sharing=locked,id=moby-build-aptlib,target=/var/lib/apt \
--mount=type=cache,sharing=locked,id=moby-build-aptcache,target=/var/cache/apt \ --mount=type=cache,sharing=locked,id=moby-build-aptcache,target=/var/cache/apt \
+2 -2
View File
@@ -57,5 +57,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ENV PATH=/usr/local/cli:$PATH ENV PATH=/usr/local/cli:$PATH
ENV AUTO_GOPATH 1 ENV AUTO_GOPATH 1
WORKDIR /usr/src/docker WORKDIR /usr/src/moby
COPY . /usr/src/docker COPY . /usr/src/moby
+7 -7
View File
@@ -45,8 +45,8 @@
# #
# 1. Clone the sources from github.com: # 1. Clone the sources from github.com:
# #
# >> git clone https://github.com/moby/moby.git C:\gopath\src\github.com\moby\moby\v2 # >> git clone https://github.com/moby/moby.git C:\usr\src\moby
# >> Cloning into 'C:\gopath\src\github.com\moby\moby\v2'... # >> Cloning into 'C:\usr\src\moby'...
# >> remote: Counting objects: 186216, done. # >> remote: Counting objects: 186216, done.
# >> remote: Compressing objects: 100% (21/21), done. # >> remote: Compressing objects: 100% (21/21), done.
# >> remote: Total 186216 (delta 5), reused 0 (delta 0), pack-reused 186195 # >> remote: Total 186216 (delta 5), reused 0 (delta 0), pack-reused 186195
@@ -59,7 +59,7 @@
# #
# 2. Change directory to the cloned docker sources: # 2. Change directory to the cloned docker sources:
# #
# >> cd C:\gopath\src\github.com\moby\moby\v2 # >> cd C:\usr\src\moby
# #
# #
# 3. Build a docker image with the components required to build the docker binaries from source # 3. Build a docker image with the components required to build the docker binaries from source
@@ -79,8 +79,8 @@
# 5. Copy the binaries out of the container, replacing HostPath with an appropriate destination # 5. Copy the binaries out of the container, replacing HostPath with an appropriate destination
# folder on the host system where you want the binaries to be located. # folder on the host system where you want the binaries to be located.
# #
# >> docker cp binaries:C:\gopath\src\github.com\moby\moby\v2\bundles\docker.exe C:\HostPath\docker.exe # >> docker cp binaries:C:\usr\src\moby\bundles\docker.exe C:\HostPath\docker.exe
# >> docker cp binaries:C:\gopath\src\github.com\moby\moby\v2\bundles\dockerd.exe C:\HostPath\dockerd.exe # >> docker cp binaries:C:\usr\src\moby\bundles\dockerd.exe C:\HostPath\dockerd.exe
# #
# #
# 6. (Optional) Remove the interim container holding the built executable binaries: # 6. (Optional) Remove the interim container holding the built executable binaries:
@@ -267,7 +267,7 @@ RUN `
Remove-Item C:\containerd.tar.gz; ` Remove-Item C:\containerd.tar.gz; `
` `
# Ensure all directories exist that we will require below.... # Ensure all directories exist that we will require below....
$srcDir = """$Env:GOPATH`\src\github.com\moby\moby\v2\bundles"""; ` $srcDir = """C:\usr\src\moby\bundles"""; `
Write-Host INFO: Ensuring existence of directory $srcDir...; ` Write-Host INFO: Ensuring existence of directory $srcDir...; `
New-Item -Force -ItemType Directory -Path $srcDir | Out-Null; ` New-Item -Force -ItemType Directory -Path $srcDir | Out-Null; `
` `
@@ -306,7 +306,7 @@ RUN `
ENTRYPOINT ["powershell.exe"] ENTRYPOINT ["powershell.exe"]
# Set the working directory to the location of the sources # Set the working directory to the location of the sources
WORKDIR ${GOPATH}\src\github.com\moby\moby\v2 WORKDIR /usr/src/moby
# Copy the sources into the container # Copy the sources into the container
COPY . . COPY . .
+2 -2
View File
@@ -86,13 +86,13 @@ BIND_DIR := $(if $(BINDDIR),$(BINDDIR),$(if $(DOCKER_HOST),,.))
# DOCKER_MOUNT can be overridden, but use at your own risk! # DOCKER_MOUNT can be overridden, but use at your own risk!
ifndef DOCKER_MOUNT ifndef DOCKER_MOUNT
DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(BIND_DIR):/go/src/github.com/moby/moby/v2/$(BIND_DIR)") DOCKER_MOUNT := $(if $(BIND_DIR),-v "$(BIND_DIR):/usr/src/moby/$(BIND_DIR)")
DOCKER_MOUNT := $(if $(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT):$(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT)) DOCKER_MOUNT := $(if $(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT):$(DOCKER_BINDDIR_MOUNT_OPTS),$(DOCKER_MOUNT))
# This allows the test suite to be able to run without worrying about the underlying fs used by the container running the daemon (e.g. aufs-on-aufs), so long as the host running the container is running a supported fs. # This allows the test suite to be able to run without worrying about the underlying fs used by the container running the daemon (e.g. aufs-on-aufs), so long as the host running the container is running a supported fs.
# The volume will be cleaned up when the container is removed due to `--rm`. # The volume will be cleaned up when the container is removed due to `--rm`.
# Note that `BIND_DIR` will already be set to `bundles` if `DOCKER_HOST` is not set (see above BIND_DIR line), in such case this will do nothing since `DOCKER_MOUNT` will already be set. # Note that `BIND_DIR` will already be set to `bundles` if `DOCKER_HOST` is not set (see above BIND_DIR line), in such case this will do nothing since `DOCKER_MOUNT` will already be set.
DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /go/src/github.com/moby/moby/v2/bundles) -v "$(CURDIR)/.git:/go/src/github.com/moby/moby/v2/.git" DOCKER_MOUNT := $(if $(DOCKER_MOUNT),$(DOCKER_MOUNT),-v /usr/src/moby/bundles) -v "$(CURDIR)/.git:/usr/src/moby/.git"
DOCKER_MOUNT_CACHE := -v docker-dev-cache:/root/.cache -v docker-mod-cache:/go/pkg/mod/ DOCKER_MOUNT_CACHE := -v docker-dev-cache:/root/.cache -v docker-mod-cache:/go/pkg/mod/
DOCKER_MOUNT_CLI := $(if $(DOCKER_CLI_PATH),-v $(shell dirname $(DOCKER_CLI_PATH)):/usr/local/cli,) DOCKER_MOUNT_CLI := $(if $(DOCKER_CLI_PATH),-v $(shell dirname $(DOCKER_CLI_PATH)):/usr/local/cli,)
+3 -3
View File
@@ -100,8 +100,8 @@ To build Moby, run:
Copy out the resulting Windows Moby Engine binary to `dockerd.exe` in the Copy out the resulting Windows Moby Engine binary to `dockerd.exe` in the
current directory: current directory:
docker cp binaries:C:\gopath\src\github.com\moby\moby\v2\bundles\docker.exe docker.exe docker cp binaries:C:\usr\src\moby\bundles\docker.exe docker.exe
docker cp binaries:C:\gopath\src\github.com\moby\moby\v2\bundles\dockerd.exe dockerd.exe docker cp binaries:C:\usr\src\moby\bundles\dockerd.exe dockerd.exe
To test it, stop the system Docker daemon and start the one you just built: To test it, stop the system Docker daemon and start the one you just built:
@@ -110,7 +110,7 @@ To test it, stop the system Docker daemon and start the one you just built:
The other make targets work too, to run unit tests try: The other make targets work too, to run unit tests try:
docker run --rm docker-builder sh -c 'cd /c/gopath/src/github.com/moby/moby/v2; hack/make.sh test-unit' docker run --rm docker-builder sh -c 'cd /c/usr/src/moby; hack/make.sh test-unit'
### 6. Remove the interim binaries container ### 6. Remove the interim binaries container
+1 -1
View File
@@ -95,7 +95,7 @@ After=firewalld.service
Type=oneshot Type=oneshot
ExecStart=/bin/true ExecStart=/bin/true
RemainAfterExit=true RemainAfterExit=true
ExecStop=cp /var/log/firewalld /go/src/github.com/moby/moby/v2/bundles/firewalld.log ExecStop=cp /var/log/firewalld /usr/src/moby/bundles/firewalld.log
[Install] [Install]
WantedBy=firewalld.service WantedBy=firewalld.service
+1 -1
View File
@@ -17,7 +17,7 @@ RUN <<EOT
wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip
unzip protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip -d /usr/local unzip protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip -d /usr/local
EOT EOT
WORKDIR /go/src/github.com/moby/moby WORKDIR /usr/src/moby
FROM base AS src FROM base AS src
WORKDIR /out WORKDIR /out
+1 -1
View File
@@ -5,7 +5,7 @@ ARG GOVULNCHECK_VERSION=v1.1.4
ARG FORMAT=text ARG FORMAT=text
FROM golang:${GO_VERSION}-alpine AS base FROM golang:${GO_VERSION}-alpine AS base
WORKDIR /go/src/github.com/moby/moby WORKDIR /usr/src/moby
RUN apk add --no-cache jq moreutils RUN apk add --no-cache jq moreutils
ARG GOVULNCHECK_VERSION ARG GOVULNCHECK_VERSION
ADD https://github.com/golang/vuln.git?ref=${GOVULNCHECK_VERSION}&keep-git-dir=1 /go/src/golang.org/x/vuln ADD https://github.com/golang/vuln.git?ref=${GOVULNCHECK_VERSION}&keep-git-dir=1 /go/src/golang.org/x/vuln
+3 -4
View File
@@ -225,10 +225,9 @@ func ensureBasicPluginBin() (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
installPath := filepath.Join(os.Getenv("GOPATH"), "bin", name) installPath := filepath.Join(os.Getenv("GOBIN"), name)
sourcePath := filepath.Join("github.com", "moby", "moby", "v2", "internal", "testutil", "fixtures", "plugin", "basic") cmd := exec.Command(goBin, "build", "-buildvcs=false", "-o", installPath, "github.com/moby/moby/v2/internal/testutil/fixtures/plugin/basic")
cmd := exec.Command(goBin, "build", "-o", installPath, sourcePath) cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GO111MODULE=auto")
cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GO111MODULE=off")
if out, err := cmd.CombinedOutput(); err != nil { if out, err := cmd.CombinedOutput(); err != nil {
return "", errors.Wrapf(err, "error building basic plugin bin: %s", string(out)) return "", errors.Wrapf(err, "error building basic plugin bin: %s", string(out))
} }