Merge pull request #1322 from chris-crone/arm

This commit is contained in:
Nicolas De loof 2021-02-18 17:48:57 +01:00 committed by GitHub
commit 0afd3ea127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 22 additions and 20 deletions

View File

@ -36,7 +36,7 @@ jobs:
- name: Setup docker CLI
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
- name: Checkout code into the Go module directory

View File

@ -32,7 +32,7 @@ jobs:
env:
BUILD_TAGS: kube,e2e
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
build:
@ -51,7 +51,7 @@ jobs:
- name: Setup docker CLI
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
- name: Checkout code into the Go module directory

View File

@ -37,7 +37,7 @@ jobs:
- name: Setup docker CLI
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
- name: Checkout code into the Go module directory

View File

@ -37,7 +37,7 @@ jobs:
- name: Setup docker CLI
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
- name: Setup Kube tools

View File

@ -16,13 +16,13 @@ jobs:
- name: Setup docker CLI
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
- name: Checkout code into the Go module directory
uses: actions/checkout@v2
- uses: actions/cache@v1
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

View File

@ -16,7 +16,7 @@
# limitations under the License.
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
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base

View File

@ -60,7 +60,9 @@ cli:
.PHONY: cross
cross:
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=arm64 $(GO_BUILD) $(TAGS) -o $(BINARY)-darwin-arm64 ./cli
GOOS=windows GOARCH=amd64 $(GO_BUILD) $(TAGS) -o $(BINARY)-windows-amd64.exe ./cli
.PHONY: test
@ -87,7 +89,9 @@ check-go-mod:
package: cross
mkdir -p dist
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-arm64.tar.gz $(TAR_TRANSFORM) packaging/LICENSE $(BINARY)-darwin-arm64
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 -r $(WORK_DIR)

View File

@ -19,16 +19,14 @@ package compose
import (
"context"
"fmt"
"github.com/docker/compose-cli/api/context/store"
"time"
"github.com/compose-spec/compose-go/types"
"github.com/docker/compose-cli/api/compose"
"github.com/spf13/cobra"
"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"
)

View File

@ -18,6 +18,7 @@ package compose
import (
"context"
"github.com/spf13/cobra"
"github.com/docker/compose-cli/api/client"

View File

@ -19,20 +19,19 @@ package compose
import (
"context"
"fmt"
"github.com/docker/docker/errdefs"
"path/filepath"
"strings"
"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/types"
moby "github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/errdefs"
"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 {
@ -96,7 +95,7 @@ func (s *composeService) Down(ctx context.Context, projectName string, options c
image := image
eg.Go(func() error {
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
}
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)
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 {
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
return nil