Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Docker app should only be used as a docker CLI plugin #667

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,3 @@ analyze:
type: go
target: github.com/docker/app/cmd/docker-app
path: cmd/docker-app
- name: github.com/docker/app/cmd/docker-app-standalone
type: go
target: github.com/docker/app/cmd/docker-app-standalone
path: cmd/docker-app-standalone
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,16 @@ check_go_env:
@test $$(go list) = "$(PKG_NAME)" || \
(echo "Invalid Go environment - The local directory structure must match: $(PKG_NAME)" && false)

cross: cross-plugin cross-standalone ## cross-compile binaries (linux, darwin, windows)
cross: cross-plugin ## cross-compile binaries (linux, darwin, windows)

cross-plugin: bin/$(BIN_NAME)-linux bin/$(BIN_NAME)-darwin bin/$(BIN_NAME)-windows.exe

cross-standalone: bin/${BIN_STANDALONE_NAME}-linux bin/${BIN_STANDALONE_NAME}-darwin bin/${BIN_STANDALONE_NAME}-windows.exe

e2e-cross: bin/$(BIN_NAME)-e2e-linux bin/$(BIN_NAME)-e2e-darwin bin/$(BIN_NAME)-e2e-windows.exe

.PHONY: dynamic
dynamic: STATIC_FLAGS :=
dynamic: bin/$(BIN_NAME)

.PHONY: bin/${BIN_STANDALONE_NAME}-windows
bin/${BIN_STANDALONE_NAME}-%.exe bin/${BIN_STANDALONE_NAME}-%: cmd/${BIN_STANDALONE_NAME} check_go_env
GOOS=$* $(GO_BUILD) -o $@ ./$<

.PHONY: bin/${BIN_STANDALONE_NAME}
bin/${BIN_STANDALONE_NAME}: cmd/${BIN_STANDALONE_NAME} check_go_env
$(GO_BUILD) -o $@$(EXEC_EXT) ./$<

.PHONY: bin/$(BIN_NAME)-e2e-windows
bin/$(BIN_NAME)-e2e-%.exe bin/$(BIN_NAME)-e2e-%: e2e bin/$(BIN_NAME)-%
GOOS=$* $(GO_TEST) -c -o $@ ./e2e/
Expand Down
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,18 @@ Removing network hello_default

## Installation

**Note**: This requires a pre-release version (19.03.0 beta 1 or later) of the
[Docker CLI](https://download.docker.com).
**Note**: Docker app is a _command line_ plugin (not be confused with docker _engine_ plugins), extending the `docker` command with `app` sub-commands.
It requires [Docker CLI](https://download.docker.com) 19.03.0 or later with experimental features enabled.
Either set environment variable `DOCKER_CLI_EXPERIMENTAL=enabled`
or update your [docker CLI configuration](https://docs.docker.com/engine/reference/commandline/cli/#experimental-features).

**Note**: Docker-app can't be installed using the `docker plugin install` command (yet)


Pre-built static binaries are available on
[GitHub releases](https://github.com/docker/app/releases) for Windows, Linux and
macOS. Each tarball contains two binaries:
* `docker-app-plugin-{linux|darwin|windows.exe}` which is a [Docker CLI plugin](https://github.com/docker/cli/issues/1534). **Note**: This requires a pre-release version of the Docker CLI
* `docker-app-standalone-{linux|darwin|windows.exe}` which is a standalone utility

To use the standalone version, use `docker-app` instead of `docker app` and all
the examples will work the same way.

### Linux or macOS

Expand All @@ -255,12 +256,7 @@ curl -fsSL --output "/tmp/docker-app-${OSTYPE}.tar.gz" "https://github.com/docke
tar xf "/tmp/docker-app-${OSTYPE}.tar.gz" -C /tmp/
```

To install as standalone:
```console
install -b "/tmp/docker-app-standalone-${OSTYPE}" /usr/local/bin/docker-app
```

To install as a Docker CLI plugin:
Install as a Docker CLI plugin:
```console
mkdir -p ~/.docker/cli-plugins && cp "/tmp/docker-app-plugin-${OSTYPE}" ~/.docker/cli-plugins/docker-app
```
Expand All @@ -273,12 +269,7 @@ Invoke-WebRequest -Uri https://github.com/docker/app/releases/download/v0.8.0/do
tar xf "docker-app.tar.gz"
```

To install as standalone, copy it somewhere in your path:
```powershell
cp docker-app-standalone-windows.exe PATH/docker-app.exe
```

To install as a Docker CLI plugin:
Install as a Docker CLI plugin:
```powershell
New-Item -ItemType Directory -Path ~/.docker/cli-plugins -ErrorAction SilentlyContinue
cp docker-app-plugin-windows.exe ~/.docker/cli-plugins/docker-app.exe
Expand Down
50 changes: 0 additions & 50 deletions cmd/docker-app-standalone/main.go

This file was deleted.

12 changes: 3 additions & 9 deletions docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,10 @@ cross: create_bin ## cross-compile binaries (linux, darwin, windows)
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/$(BIN_NAME)-linux bin/$(BIN_NAME)-linux
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/$(BIN_NAME)-darwin bin/$(BIN_NAME)-darwin
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/$(BIN_NAME)-windows.exe bin/$(BIN_NAME)-windows.exe
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/${BIN_STANDALONE_NAME}-linux bin/${BIN_STANDALONE_NAME}-linux
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/${BIN_STANDALONE_NAME}-darwin bin/${BIN_STANDALONE_NAME}-darwin
docker cp $(CROSS_CTNR_NAME):$(PKG_PATH)/bin/${BIN_STANDALONE_NAME}-windows.exe bin/${BIN_STANDALONE_NAME}-windows.exe
docker rm $(CROSS_CTNR_NAME)
@$(call chmod,+x,bin/$(BIN_NAME)-linux)
@$(call chmod,+x,bin/$(BIN_NAME)-darwin)
@$(call chmod,+x,bin/$(BIN_NAME)-windows.exe)
@$(call chmod,+x,bin/${BIN_STANDALONE_NAME}-linux)
@$(call chmod,+x,bin/${BIN_STANDALONE_NAME}-darwin)
@$(call chmod,+x,bin/${BIN_STANDALONE_NAME}-windows.exe)

cli-cross: create_bin
docker build $(BUILD_ARGS) --target=build -t $(CLI_IMAGE_NAME) .
Expand Down Expand Up @@ -85,11 +79,11 @@ e2e-cross: create_bin
@$(call chmod,+x,bin/test2json-darwin)

tars:
tar --transform='flags=r;s|$(BIN_NAME)-linux|$(BIN_NAME)-plugin-linux|' -czf bin/$(BIN_NAME)-linux.tar.gz -C bin $(BIN_NAME)-linux ${BIN_STANDALONE_NAME}-linux
tar --transform='flags=r;s|$(BIN_NAME)-linux|$(BIN_NAME)-plugin-linux|' -czf bin/$(BIN_NAME)-linux.tar.gz -C bin $(BIN_NAME)-linux
tar czf bin/$(BIN_NAME)-e2e-linux.tar.gz -C bin $(BIN_NAME)-e2e-linux
tar --transform='flags=r;s|$(BIN_NAME)-darwin|$(BIN_NAME)-plugin-darwin|' -czf bin/$(BIN_NAME)-darwin.tar.gz -C bin $(BIN_NAME)-darwin ${BIN_STANDALONE_NAME}-darwin
tar --transform='flags=r;s|$(BIN_NAME)-darwin|$(BIN_NAME)-plugin-darwin|' -czf bin/$(BIN_NAME)-darwin.tar.gz -C bin $(BIN_NAME)-darwin
tar czf bin/$(BIN_NAME)-e2e-darwin.tar.gz -C bin $(BIN_NAME)-e2e-darwin
tar --transform='flags=r;s|$(BIN_NAME)-windows|$(BIN_NAME)-plugin-windows|' -czf bin/$(BIN_NAME)-windows.tar.gz -C bin $(BIN_NAME)-windows.exe ${BIN_STANDALONE_NAME}-windows.exe
tar --transform='flags=r;s|$(BIN_NAME)-windows|$(BIN_NAME)-plugin-windows|' -czf bin/$(BIN_NAME)-windows.tar.gz -C bin $(BIN_NAME)-windows.exe
tar czf bin/$(BIN_NAME)-e2e-windows.tar.gz -C bin $(BIN_NAME)-e2e-windows.exe

test: test-unit test-e2e ## run all tests
Expand Down
1 change: 0 additions & 1 deletion vars.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PKG_NAME := github.com/docker/app
BIN_NAME ?= docker-app
BIN_STANDALONE_NAME := ${BIN_NAME}-standalone
E2E_NAME := $(BIN_NAME)-e2e

# Variables for fossa scan
Expand Down