Skip to content

Commit

Permalink
Merge branch 'main' into docker-cli-plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Eugén Cowie <eugencowie@users.noreply.github.com>
  • Loading branch information
eugencowie committed Sep 27, 2024
2 parents cd5a361 + c9eb5db commit 63bfacc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions pkg/docker-compose/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ func (m *Mixin) Build(ctx context.Context) error {
dockerComposeVersion = dockerComposeDefaultVersion
}

dockerfileLines := fmt.Sprintf(`RUN apt-get update && apt-get install -y curl && \
curl -fL "https://github.com/docker/compose/releases/download/v%s/docker-compose-linux-x86_64" -o /usr/local/lib/docker/cli-plugins/docker-compose --create-dirs && \
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose && \
ln -s /usr/local/lib/docker/cli-plugins/docker-compose /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
RUN ln -s /usr/local/lib/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose`, dockerComposeVersion)

fmt.Fprintln(m.Out, dockerfileLines)

Expand Down
6 changes: 2 additions & 4 deletions pkg/docker-compose/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import (
)

func TestMixin_Build(t *testing.T) {
const buildOutput = `RUN apt-get update && apt-get install -y curl && \
curl -fL "https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64" -o /usr/local/lib/docker/cli-plugins/docker-compose --create-dirs && \
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose && \
ln -s /usr/local/lib/docker/cli-plugins/docker-compose /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
RUN ln -s /usr/local/lib/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose
`

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

0 comments on commit 63bfacc

Please sign in to comment.