Skip to content

Commit

Permalink
Merge pull request #36 from jaudiger/update_docker_version
Browse files Browse the repository at this point in the history
feat(docker): Update default version to latest major version.
  • Loading branch information
carolynvs authored Jul 22, 2021
2 parents 5103eb5 + fc7f157 commit fc8e3bb
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ generate: packr2
HAS_PACKR2 := $(shell command -v packr2)
packr2:
ifndef HAS_PACKR2
$(GO) get -u github.com/gobuffalo/packr/v2/packr2
cd /tmp && $(GO) get github.com/gobuffalo/packr/v2/packr2@v2.6.0
endif

xbuild-all: generate
Expand Down Expand Up @@ -90,4 +90,4 @@ clean: clean-packr
-rm -fr bin/

clean-packr: packr2
cd pkg/docker && packr2 clean
cd pkg/docker && packr2 clean
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A Docker Mixin for Porter

This is a Docker mixin for Porter. The mixin provides the Docker CLI.
This is a Docker mixin for Porter. The mixin provides the Docker CLI.

[![Build Status](https://dev.azure.com/getporter/porter/_apis/build/status/docker-mixin?branchName=main)](https://dev.azure.com/getporter/porter/_build/latest?definitionId=12&branchName=main)

Expand All @@ -17,13 +17,13 @@ mixins:
## Mixin Configuration
The Docker client version can be specified via the `clientVersion` configuration when declaring this mixin. The default client version is currently set to 19.03.8.
The Docker client version can be specified via the `clientVersion` configuration when declaring this mixin. The default client version is currently set to 20.10.7.
```yaml
- docker:
clientVersion: 19.03.8
clientVersion: 20.10.7
```
## Mixin Commands
The commands available are docker pull, push, build, run, remove, and login.
The commands available are docker pull, push, build, run, remove, and login.

## Mixin Syntax & Examples
The same syntax applies for install, upgrade, and uninstall.
Expand Down Expand Up @@ -123,7 +123,7 @@ You can specify either the tag or the digest.
description: "Description of the command"
run:
image: IMAGE
name: NAME
name: NAME
detach: BOOL #defaults to false
ports:
- host: NUMBER # porter exposed on the host
Expand Down Expand Up @@ -196,12 +196,11 @@ You can specify either the tag or the digest.

#### Syntax
Username and password are optional because the mixin will default to using environment variables provided by DOCKER_USERNAME and DOCKER_PASSWORD from a parameter or a credential.
See an [example](/examples/docker-mixin-test/README.md#notes-on-docker-login) for how to use
docker login and securely provide your username and password.
See an [example](/examples/docker-mixin-test/README.md#notes-on-docker-login) for how to use docker login and securely provide your username and password.
```yaml
- docker:
description: "Description of the command"
login:
login:
username: USERNAME #OPTIONAL
password: PASSWORD #OPTIONAL
arguments:
Expand Down
2 changes: 1 addition & 1 deletion examples/docker-mixin-test/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ credentials:

mixins:
- docker:
clientVersion: 19.03.12
clientVersion: 20.10.7

install:
- docker:
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type BuildInput struct {
// MixinConfig represents configuration that can be set on the docker mixin in porter.yaml
// mixins:
// - docker:
// clientVersion: 19.03.8
// clientVersion: 20.10.7
type MixinConfig struct {
ClientVersion string `yaml:"clientVersion,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestMixin_Build(t *testing.T) {
err := m.Build()
require.NoError(t, err)

wantOutput := fmt.Sprintf(dockerfileLines, "19.03.8")
wantOutput := fmt.Sprintf(dockerfileLines, "20.10.7")

gotOutput := m.TestContext.GetOutput()
assert.Equal(t, wantOutput, gotOutput)
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/mixin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/pkg/errors"
)

const defaultDockerVersion = "19.03.8"
const defaultDockerVersion = "20.10.7"

type Mixin struct {
*context.Context
Expand Down
2 changes: 1 addition & 1 deletion pkg/docker/testdata/build-input-with-version.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
config:
clientVersion: 19.03.12
clientVersion: 19.03.12

0 comments on commit fc8e3bb

Please sign in to comment.