0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-24 12:50:41 +00:00

refactor: rename parameter dockerfile to containerfile

This commit is contained in:
Robert Kaussow 2023-08-14 09:39:28 +02:00
parent 829d5cc6e9
commit fdf9b22e08
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
9 changed files with 68 additions and 47 deletions

View File

@ -6,7 +6,7 @@ ipv6
buildkit
json
config
dockerfile
containerfile
og
gzip
toml

26
.github/settings.yml vendored
View File

@ -43,3 +43,29 @@ labels:
- name: wontfix
color: ffffff
description: This will not be worked on
branches:
- name: main
protection:
required_pull_request_reviews: null
required_status_checks:
strict: false
contexts:
- ci/woodpecker/pr/test
- ci/woodpecker/pr/build-binary
- ci/woodpecker/pr/build-container
- ci/woodpecker/pr/docs
enforce_admins: false
required_linear_history: true
restrictions: null
- name: docs
protection:
required_pull_request_reviews: null
required_status_checks: null
enforce_admins: true
required_linear_history: true
restrictions:
apps: []
users: []
teams:
- bot

View File

@ -9,7 +9,7 @@ steps:
dryrun:
image: quay.io/thegeeklab/drone-docker-buildx:latest
settings:
dockerfile: Dockerfile.multiarch
containerfile: Containerfile.multiarch
dry_run: true
platforms:
- linux/amd64
@ -24,7 +24,7 @@ steps:
image: quay.io/thegeeklab/drone-docker-buildx:latest
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
containerfile: Containerfile.multiarch
password:
from_secret: docker_password
platforms:
@ -45,7 +45,7 @@ steps:
image: quay.io/thegeeklab/drone-docker-buildx:latest
settings:
auto_tag: true
dockerfile: Dockerfile.multiarch
containerfile: Containerfile.multiarch
password:
from_secret: quay_password
platforms:

View File

@ -100,18 +100,13 @@ steps:
Build the binary with the following command:
```shell
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on
make build
```
Build the Docker image with the following command:
```shell
docker build --file docker/Dockerfile.amd64 --tag thegeeklab/wp-docker-buildx .
docker build --file docker/Containerfile.multiarch --tag thegeeklab/wp-docker-buildx .
```
## Test
@ -121,8 +116,8 @@ docker run --rm \
-e PLUGIN_TAG=latest \
-e PLUGIN_REPO=octocat/hello-world \
-e CI_COMMIT_SHA=00000000 \
-v $(pwd):$(pwd) \
-w $(pwd) \
-v $(pwd):/build:z \
-w /build \
--privileged \
thegeeklab/wp-docker-buildx --dry-run
```

View File

@ -90,9 +90,9 @@ properties:
defaultValue: false
required: false
- name: dockerfile
description: Set dockerfile to use for the image build.
defaultValue: Dockerfile
- name: containerfile
description: Set the containerfile to use for the image build.
defaultValue: Containerfile
type: string
required: false

View File

@ -116,11 +116,11 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
Category: category,
},
&cli.StringFlag{
Name: "dockerfile",
EnvVars: []string{"PLUGIN_DOCKERFILE"},
Usage: "dockerfile to use for the image build",
Value: "Dockerfile",
Destination: &settings.Build.Dockerfile,
Name: "containerfile",
EnvVars: []string{"PLUGIN_CONTAINERFILE"},
Usage: "containerfile to use for the image build",
Value: "Containerfile",
Destination: &settings.Build.Containerfile,
Category: category,
},
&cli.StringFlag{

View File

@ -76,7 +76,7 @@ func commandBuild(build Build, dryrun bool) *execabs.Cmd {
"buildx",
"build",
"--rm=true",
"-f", build.Dockerfile,
"-f", build.Containerfile,
}
defaultBuildArgs := []string{

View File

@ -48,32 +48,32 @@ type Login struct {
// Build defines Docker build parameters.
type Build struct {
Ref string // Git commit ref
Branch string // Git repository branch
Dockerfile string // Docker build Dockerfile
Context string // Docker build context
TagsAuto bool // Docker build auto tag
TagsSuffix string // Docker build tags with suffix
Tags cli.StringSlice // Docker build tags
ExtraTags cli.StringSlice // Docker build tags including registry
Platforms cli.StringSlice // Docker build target platforms
Args cli.StringSlice // Docker build args
ArgsEnv cli.StringSlice // Docker build args from env
Target string // Docker build target
Pull bool // Docker build pull
CacheFrom []string // Docker build cache-from
CacheTo string // Docker build cache-to
Compress bool // Docker build compress
Repo string // Docker build repository
NoCache bool // Docker build no-cache
AddHost cli.StringSlice // Docker build add-host
Quiet bool // Docker build quiet
Output string // Docker build output folder
NamedContext cli.StringSlice // Docker build named context
Labels cli.StringSlice // Docker build labels
Provenance string // Docker build provenance attestation
SBOM string // Docker build sbom attestation
Secrets []string // Docker build secrets
Ref string // Git commit ref
Branch string // Git repository branch
Containerfile string // Docker build Containerfile
Context string // Docker build context
TagsAuto bool // Docker build auto tag
TagsSuffix string // Docker build tags with suffix
Tags cli.StringSlice // Docker build tags
ExtraTags cli.StringSlice // Docker build tags including registry
Platforms cli.StringSlice // Docker build target platforms
Args cli.StringSlice // Docker build args
ArgsEnv cli.StringSlice // Docker build args from env
Target string // Docker build target
Pull bool // Docker build pull
CacheFrom []string // Docker build cache-from
CacheTo string // Docker build cache-to
Compress bool // Docker build compress
Repo string // Docker build repository
NoCache bool // Docker build no-cache
AddHost cli.StringSlice // Docker build add-host
Quiet bool // Docker build quiet
Output string // Docker build output folder
NamedContext cli.StringSlice // Docker build named context
Labels cli.StringSlice // Docker build labels
Provenance string // Docker build provenance attestation
SBOM string // Docker build sbom attestation
Secrets []string // Docker build secrets
}
func New(options wp.Options, settings *Settings) *Plugin {