mirror of
https://github.com/docker/compose.git
synced 2025-07-27 15:44:08 +02:00
Merge pull request #1322 from chris-crone/arm
This commit is contained in:
commit
0afd3ea127
2
.github/workflows/aci-tests.yml
vendored
2
.github/workflows/aci-tests.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup docker CLI
|
- name: Setup docker CLI
|
||||||
run: |
|
run: |
|
||||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
|
||||||
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
||||||
|
|
||||||
- name: Checkout code into the Go module directory
|
- name: Checkout code into the Go module directory
|
||||||
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUILD_TAGS: kube,e2e
|
BUILD_TAGS: kube,e2e
|
||||||
run: |
|
run: |
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.33.0
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.37.0
|
||||||
make -f builder.Makefile lint
|
make -f builder.Makefile lint
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup docker CLI
|
- name: Setup docker CLI
|
||||||
run: |
|
run: |
|
||||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
|
||||||
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
||||||
|
|
||||||
- name: Checkout code into the Go module directory
|
- name: Checkout code into the Go module directory
|
||||||
|
2
.github/workflows/ecs-tests.yml
vendored
2
.github/workflows/ecs-tests.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup docker CLI
|
- name: Setup docker CLI
|
||||||
run: |
|
run: |
|
||||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
|
||||||
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
||||||
|
|
||||||
- name: Checkout code into the Go module directory
|
- name: Checkout code into the Go module directory
|
||||||
|
2
.github/workflows/kube-tests.yml
vendored
2
.github/workflows/kube-tests.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup docker CLI
|
- name: Setup docker CLI
|
||||||
run: |
|
run: |
|
||||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
|
||||||
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
||||||
|
|
||||||
- name: Setup Kube tools
|
- name: Setup Kube tools
|
||||||
|
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
@ -16,13 +16,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup docker CLI
|
- name: Setup docker CLI
|
||||||
run: |
|
run: |
|
||||||
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
|
curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz | tar xz
|
||||||
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
|
||||||
|
|
||||||
- name: Checkout code into the Go module directory
|
- name: Checkout code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
ARG GO_VERSION=1.16-alpine
|
ARG GO_VERSION=1.16-alpine
|
||||||
ARG GOLANGCI_LINT_VERSION=v1.33.0-alpine
|
ARG GOLANGCI_LINT_VERSION=v1.37.0-alpine
|
||||||
ARG PROTOC_GEN_GO_VERSION=v1.4.3
|
ARG PROTOC_GEN_GO_VERSION=v1.4.3
|
||||||
|
|
||||||
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
|
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
|
||||||
|
@ -60,7 +60,9 @@ cli:
|
|||||||
.PHONY: cross
|
.PHONY: cross
|
||||||
cross:
|
cross:
|
||||||
GOOS=linux GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-linux-amd64 ./cli
|
GOOS=linux GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-linux-amd64 ./cli
|
||||||
|
GOOS=linux GOARCH=arm64 $(GO_BUILD) $(TAGS) -o $(BINARY)-linux-arm64 ./cli
|
||||||
GOOS=darwin GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-darwin-amd64 ./cli
|
GOOS=darwin GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-darwin-amd64 ./cli
|
||||||
|
GOOS=darwin GOARCH=arm64 $(GO_BUILD) $(TAGS) -o $(BINARY)-darwin-arm64 ./cli
|
||||||
GOOS=windows GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-windows-amd64.exe ./cli
|
GOOS=windows GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-windows-amd64.exe ./cli
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
@ -87,7 +89,9 @@ check-go-mod:
|
|||||||
package: cross
|
package: cross
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
tar -czf dist/docker-linux-amd64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-linux-amd64
|
tar -czf dist/docker-linux-amd64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-linux-amd64
|
||||||
|
tar -czf dist/docker-linux-arm64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-linux-arm64
|
||||||
tar -czf dist/docker-darwin-amd64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-darwin-amd64
|
tar -czf dist/docker-darwin-amd64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-darwin-amd64
|
||||||
|
tar -czf dist/docker-darwin-arm64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-darwin-arm64
|
||||||
cp $(BINARY)-windows-amd64.exe $(WORK_DIR)/docker.exe
|
cp $(BINARY)-windows-amd64.exe $(WORK_DIR)/docker.exe
|
||||||
rm -f dist/docker-windows-amd64.zip && zip dist/docker-windows-amd64.zip -j packaging/LICENSE $(WORK_DIR)/docker.exe
|
rm -f dist/docker-windows-amd64.zip && zip dist/docker-windows-amd64.zip -j packaging/LICENSE $(WORK_DIR)/docker.exe
|
||||||
rm -r $(WORK_DIR)
|
rm -r $(WORK_DIR)
|
||||||
|
@ -19,16 +19,14 @@ package compose
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/docker/compose-cli/api/context/store"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/compose"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/client"
|
"github.com/docker/compose-cli/api/client"
|
||||||
|
"github.com/docker/compose-cli/api/compose"
|
||||||
|
"github.com/docker/compose-cli/api/context/store"
|
||||||
"github.com/docker/compose-cli/api/progress"
|
"github.com/docker/compose-cli/api/progress"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ package compose
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/client"
|
"github.com/docker/compose-cli/api/client"
|
||||||
|
@ -19,20 +19,19 @@ package compose
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/docker/docker/errdefs"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/compose"
|
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/progress"
|
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/cli"
|
"github.com/compose-spec/compose-go/cli"
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
|
"github.com/docker/docker/errdefs"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
|
"github.com/docker/compose-cli/api/compose"
|
||||||
|
"github.com/docker/compose-cli/api/progress"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) Down(ctx context.Context, projectName string, options compose.DownOptions) error {
|
func (s *composeService) Down(ctx context.Context, projectName string, options compose.DownOptions) error {
|
||||||
@ -96,7 +95,7 @@ func (s *composeService) Down(ctx context.Context, projectName string, options c
|
|||||||
image := image
|
image := image
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
resourceToRemove = true
|
resourceToRemove = true
|
||||||
return s.removeImage(image, w, err, ctx)
|
return s.removeImage(ctx, image, w)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,10 +121,10 @@ func (s *composeService) getServiceImages(options compose.DownOptions, projectNa
|
|||||||
return images
|
return images
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) removeImage(image string, w progress.Writer, err error, ctx context.Context) error {
|
func (s *composeService) removeImage(ctx context.Context, image string, w progress.Writer) error {
|
||||||
id := fmt.Sprintf("Image %s", image)
|
id := fmt.Sprintf("Image %s", image)
|
||||||
w.Event(progress.NewEvent(id, progress.Working, "Removing"))
|
w.Event(progress.NewEvent(id, progress.Working, "Removing"))
|
||||||
_, err = s.apiClient.ImageRemove(ctx, image, moby.ImageRemoveOptions{})
|
_, err := s.apiClient.ImageRemove(ctx, image, moby.ImageRemoveOptions{})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user