Skip to content

Commit

Permalink
Create extra set of UBI based images (elastic#14796)
Browse files Browse the repository at this point in the history
* Create extra set of UBI based images
* Rename container to beat-ubi
* Create a docker-ubi spec
* Move ubi updates to elastic_beat_xpack section.
* Expand extra vars for docker image name.
* Name image with ubi7 instead of ubi
  • Loading branch information
mikemadden42 authored Dec 1, 2019
1 parent 6c279eb commit 03f7931
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dev-tools/mage/dockerbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,18 @@ func (b *dockerBuilder) prepareBuild() error {
}

func (b *dockerBuilder) dockerBuild() (string, error) {
tag := fmt.Sprintf("%s:%s", b.Name, b.Version)
imageName := b.Name
if name, _ := b.ExtraVars["image_name"]; name != "" {
var err error
imageName, err = b.Expand(name)
if err != nil {
return "", err
}
}
tag := fmt.Sprintf("%s:%s", imageName, b.Version)
if b.Snapshot {
tag = tag + "-SNAPSHOT"
}

if repository, _ := b.ExtraVars["repository"]; repository != "" {
tag = fmt.Sprintf("%s/%s", repository, tag)
}
Expand Down
13 changes: 13 additions & 0 deletions dev-tools/packaging/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ shared:
extra_vars:
repository: 'docker.elastic.co/beats'

- &docker_ubi_spec
extra_vars:
image_name: '{{.BeatName}}-ubi7'
from: 'registry.access.redhat.com/ubi7/ubi:7.7'

#
# License modifiers for Apache 2.0
#
Expand Down Expand Up @@ -338,6 +343,14 @@ specs:
<<: *elastic_docker_spec
<<: *elastic_license_for_binaries

- os: linux
types: [docker]
spec:
<<: *docker_spec
<<: *docker_ubi_spec
<<: *elastic_docker_spec
<<: *elastic_license_for_binaries

# Elastic Beat with Elastic License and binary taken from the x-pack dir.
elastic_beat_xpack_separate_binaries:
###
Expand Down

0 comments on commit 03f7931

Please sign in to comment.