Skip to content

Commit

Permalink
Merge pull request #48 from eugencowie/docker-cli-plugin
Browse files Browse the repository at this point in the history
Install as a Docker CLI plugin
  • Loading branch information
schristoff authored Sep 30, 2024
2 parents c9eb5db + 38eb6c9 commit da23a6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/docker-compose/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func (m *Mixin) Build(ctx context.Context) error {
dockerComposeVersion = dockerComposeDefaultVersion
}

dockerfileLines := fmt.Sprintf(`ADD --chmod=755 https://github.com/docker/compose/releases/download/v%s/docker-compose-linux-x86_64 /usr/local/bin/docker-compose`, dockerComposeVersion)
dockerfileLines := fmt.Sprintf(`ADD --chmod=755 https://github.com/docker/compose/releases/download/v%s/docker-compose-linux-x86_64 /usr/local/lib/docker/cli-plugins/docker-compose
ENV PATH="$PATH:/usr/local/lib/docker/cli-plugins"`, dockerComposeVersion)

fmt.Fprintln(m.Out, dockerfileLines)

Expand Down
3 changes: 2 additions & 1 deletion pkg/docker-compose/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
)

func TestMixin_Build(t *testing.T) {
const buildOutput = `ADD --chmod=755 https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 /usr/local/bin/docker-compose
const buildOutput = `ADD --chmod=755 https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 /usr/local/lib/docker/cli-plugins/docker-compose
ENV PATH="$PATH:/usr/local/lib/docker/cli-plugins"
`

t.Run("build", func(t *testing.T) {
Expand Down

0 comments on commit da23a6b

Please sign in to comment.