Commit graph

39 commits

Author SHA1 Message Date
kaisecheng
5ead3a9880
add openssl command to wolfi image (#16972) 2025-01-28 17:31:56 +00:00
github-actions[bot]
886a0c7ed7
update ironbank image to ubi9/9.5 (#16825) (#16827)
(cherry picked from commit dbb06c20cf)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2024-12-19 22:57:27 +00:00
João Duarte
1484614405
Wolfi-based image flavor (#16189)
* Add wolfi as an option to the build process
* Add docker acceptance tests for the wolfi image
* Change how tests are done on the java process, due to "ps -C" not being available on wolfi

replaces and closes https://github.com/elastic/logstash/pull/16116

Co-authored-by: Andres Rodriguez <andreserl@gmail.com>
2024-06-17 15:48:02 +01:00
Rob Bavey
b9b9ad9395
Use dpkg --print-architecture in Dockerfile to ascertain architecture (#16076)
* Use `dpkg --print-architecture` in Dockerfile to ascertain architecture
2024-04-12 15:47:34 -04:00
Rob Bavey
e5b2b3d92b
Update Dockerfile to select appropriate architecture on build box (#16053)
This commit adds logic to copy the appropriate env2yaml file to the Docker image
* Clean up env2yaml folder

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2024-04-04 18:15:54 -04:00
kaisecheng
a7779664af
Modernize ironbank Dockerfile (#16022)
- remove golang assets (go1.17.8.linux-amd64.tar.gz)
- remove yaml lib assets (v2.3.0.tar.gz)
- use go container to build env2yaml
- remove unnecessary layers
- remove HEALTHCHECK
- switch yum to dnf

Fixes: elastic/ingest-dev#3008
2024-03-28 11:15:01 +00:00
Rob Bavey
32052a263f
Remove curl installation step, as curl-minimal is already provided in ubi9 (#15998) 2024-03-12 09:50:52 -04:00
Rob Bavey
b640e7e851
Add arm64 support for env2yaml (#15980)
* Add arm64 support for env2yaml

This commit builds env2yaml in arm64 and amd64 flavors, and uses
$TARGETARCH in the Dockerfile to ensure that the correct version is used
when building for alternative architectures

Fixes: #15913

* Add env2yaml executables to build context

* Split `COPY_FILES` for readability

Co-authored-by: Andrea Selva <selva.andre@gmail.com>

---------

Co-authored-by: Andrea Selva <selva.andre@gmail.com>
2024-03-08 10:47:01 -05:00
kaisecheng
4e6815b1ea
add openssl to ubi image (#15929)
Logstash on ECK requires openssl command to build TLS keystore.
This commit adds `microdnf install -y openssl` to ensure the command exists in ubi image.
2024-02-09 18:40:02 +00:00
João Duarte
de01eb6ee3
Remove jinja2 in favor of erb templates (#15142)
This commit removes the jinja2 templates and consequently the dependency on Python
2024-02-09 13:49:58 +00:00
Nassim Kammah
9256de43c3
Remove Nassim Kammah from list of maintainers (#15709) 2024-01-18 14:05:25 +01:00
Rob Bavey
a398c93eec
Update Iron Bank base image to ubi9.2 (#15490) 2023-10-26 09:53:29 -04:00
Rob Bavey
57cc392d0e
Update ubi8 base image to 8.7 (#15487) 2023-10-23 12:47:27 -04:00
kaisecheng
c99a7b2f46
Add env LOG_STYLE to control the log behavior (#14949)
This commit adds environment variable LOG_STYLE to control log behavior of docker container
`console` - this is the default to output to standout
`file` - log to disk.

Fixed: #14941
2023-03-08 23:25:33 +00:00
Rob Bavey
7e25a0d76a
Update Ironbank base image to 8.7 (#14812) 2022-12-16 10:12:09 -05:00
Rob Bavey
c124cc6c9e
Remove the chmod g+s command from ironbank docker image (#14435) 2022-08-16 10:10:06 -04:00
lior-orca
5767b3b986
Ensuring COPY instruction is used instead of ADD in Dockerfiles (#14423) 2022-08-12 14:59:52 +01:00
Julien Mailleret
79c36c5ac2
Fix artifact path for integration with ubireleaser (#14319)
<artifact_path> need to be hardcoded so it can be replaced properly by
the ubireleaser during the creation of the Ironbank merge request.

Relates to https://github.com/elastic/logstash/pull/14298/
2022-06-30 16:21:08 +01:00
kaisecheng
dfb109843d
Support ironbank docker build (#14298)
This commit adds a rake task `rake artifact:dockerfile_ironbank` to generate ironbank docker build context for automatic release.
The output can be found in build/logstash-ironbank-$VERSION-docker-build-context.tar.gz

Co-authored-by: Rob Bavey <rob.bavey@elastic.co>
2022-06-28 10:29:55 +01:00
Rob Bavey
11cf6a1974
Update logstash docker to use ubuntu 20.04 base image (#13442)
* Update logstash docker to use ubuntu 20.04 base image
* Correctly set locale for ubuntu docker image
* tiny typo fix: ubunto -> ubuntu

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2021-12-09 09:38:56 -05:00
João Duarte
d1b12ded1d
fix ubi8 docker image creation by skipping yum clean metadata (#12902)
ubi8 image uses microdnf as a package manager, and microdnf does
not support the "yum clean metadata" command. This commit adds
the logic to skip this command if the image_flavor is ubi8
2021-05-12 15:05:48 +01:00
Rob Bavey
d0e79553b5
[Build] On aarch64 docker build, install noarch version of bind-license first (#12891)
On aarch64, yum does not pick the correct 'bind-license' package,
this commit installs a specific noarch RPM

This commit also adds retry to the yum installs and updates.
2021-05-11 22:40:43 -04:00
Rob Bavey
872546ec19
Update dockerfile template to allow selection of architecture by env (#12636)
This commit updates the dockerfile template to support environment
variables being used to retrieve the architecture appropriate logstash
build, in the same way as is currently done for the Elasticsearch docker build.
This is required to support the official dockerhub builds of Logstash.

Relates #12578
2021-02-03 09:25:49 -05:00
Rob Bavey
81a9857944
Add UBI8 image specific labels back to the docker image (#12498)
these labels are required for redhat openshift certification.

These commit reintroduces the labels for the ubi8 image only, and adds
acceptance tests to ensure these labels are correct and not inherited
2020-12-04 14:17:42 -05:00
Rob Bavey
934e44da13
Add additional description label (#12452)
Removing the freeform description labels left the container metadata
without a description label. This commit adds a description under the
"org.opencontainers.image.description" label
2020-11-18 14:03:42 -05:00
Rob Bavey
5ee83e8cc7
Fix docker image metadata (#12447)
This commit fixes two issues with the docker metadata:

Removes non-OCI compliant freeform metadata labels
Uses a consistent build date for all the docker images and dockerfiles

Additionally, this commit adds a `build_docker_ubi8` rake task to enable
`ci/docker_acceptance_tests.sh` to run with no options to build all
docker images for the architecture.
2020-11-18 12:29:37 -05:00
Rob Bavey
15e2fdca40
Docker Build: Add ability to detect/set build architecture (#12302)
This commit adds the ability for the docker build to build artifacts for multiple architectures.
By default, the target architecture is inferred from the architecture of the machine the build is being
run from - running the build from an aarch64 machine will build an aarch64 docker image, while building
from an x86_64 machine will build an x86_64 docker image.

This can be overridden by setting the environment variable DOCKER_ARCHITECTURE to either `x86_64` or
`aarch64`.

This commit also updates the integration tests to test against the architecture from the machine the test
is being run on, and includes the target architecture in the test description.
2020-10-05 09:55:23 -04:00
Rob Bavey
5c7d5ac8c0 Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (x86_64)
Create new artifacts with bundled JDK for the supported platforms on x86_64. Download JDK packages from AdoptOpenJDK site, the selected version is loaded from `versions.yml`.
Changed also the launch scripts to give precedence to JAVA_HOME, then fallback on bundled JDK if present, as last resource go to the system Java.

New artifacts produced with bundled JDK are:
- tar.gz with JDK for Linux and Darwin
- zip file for Windows
- dep and rpm
- Docker image

All artifacts without JDK are now postfixed with '-no-jdk' while the ones with JDK included has the architecture extension.

Covered with tests the touched parts

Co-authored-by: Rob Bavey <robbavey@users.noreply.github.com>
2020-09-23 08:18:31 -07:00
Rob Bavey
6a22b2b348
Update ubi8-minimal to pull from elastic docker registry (#12253) 2020-09-21 14:14:39 -04:00
Rob Bavey
517b6ca114
Fix docker image certification (#12242)
This commit includes the required changes to pass RedHat docker image certification.
This includes:
 Moving license files to /licenses folder
 Adding required base labels for name, description, vendor and summary

Relates: https://github.com/elastic/dev/issues/1287
2020-09-15 16:21:31 -04:00
Rob Bavey
dd4ab61454 Limit locale changes to ubi8 container 2020-08-20 07:35:49 -07:00
Rob Bavey
1c675aa74b Add UBI8 docker image to artifacts
This commit adds the rake docker_ubi8 rake task, and associated
changes to the docker template and makefiles.

This commit also refactors the acceptance tests to extract xpack tests
into a helper class to allow the same tests to be used in both 'full'
and 'ubi8' docker image tests
2020-08-20 07:35:49 -07:00
Rob Bavey
ef4ae8147e Fix docker image labels
Prior to this commit, the value of `org.label-schema.license` and
the values in `org.opencontainers.image.*` were not set, and therefore
would be inherited from the base OS image.
2020-07-23 12:48:59 -07:00
Rob Bavey
5c4d35343a Removes UBI7 docker code
Removal of code (#11335) to generate UBI7 based docker images, as this is not
being used for now

Fixes #11489
2020-01-14 14:04:54 +00:00
Rob Bavey
830e49a159 Add UBI based docker images
This commit adds support for images based on UBI7 base image

Closes #11265

Fixes #11335
2019-12-03 13:51:49 +00:00
Joao Duarte
75725e1a51 generate tarballs for docker images
Fixes #10819
2019-05-24 15:09:26 +00:00
Joao Duarte
088ece441a
rake task to generate dockerfile
* dont include docker tasks in artifact:all
* don't rebuild tar/zip if source hasn't changed
* allow SKIP_PREPARE to avoid tar creation if no modifications
* don't need a tarball to generate the dockerfile
* remove docker tests as they weren't working anymore

This commit adds a task to produce all necessary files to generate a docker image.

```
% RELEASE=1 rake artifact:dockerfile
....
Dockerfile created in /tmp/elastic/logstash/build/docker
% tree /tmp/elastic/logstash/build/docker
/tmp/elastic/logstash/build/docker
├── Dockerfile
├── bin
│   └── docker-entrypoint
├── config
│   ├── log4j2.properties
│   ├── logstash-full.yml
│   └── pipelines.yml
├── env2yaml
│   └── env2yaml
└── pipeline
    └── default.conf
% docker build --rm .
.....
Step 19/20 : LABEL org.label-schema.schema-version="1.0"   org.label-schema.vendor="Elastic"   org.label-schema.name="logstash"   org.label-schema.version="7.0.0"   org.label-schema.url="https://www.elastic.co/products/logstash"   org.label-schema.vcs-url="https://github.com/elastic/logstash" license="Elastic License"
 ---> Using cache
 ---> f622d7555220
Step 20/20 : ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
 ---> Using cache
 ---> b6feba7f4934
Successfully built b6feba7f4934
```

This task works only for releases (not snapshots).

This commit also adds a few tweaks to the artifacts building:

Using `SKIP_PREPARE=1` in `rake artifact:tar` or `rake artifact:tar_oss` will make a check to not rebuild the tarball if there are no code modifications.

These two changes are made since docker image build is new and we want to keep it out of artifact:all for a while. And if we're running these separately, we want to ensure the tarball built is used in the docker image (versus building a new one for each `rake artifact:tar` )

This means that, to generate all artifacts including docker images and dockerfile, it's necessary to run:

```
RELEASE=1 rake artifact:all
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker
SKIP_PREPARE=1 RELEASE=1 rake artifact:docker_oss
RELEASE=1 rake artifact:dockerfile
```
2019-04-22 22:53:40 +01:00
João Duarte
c657f90362
moved to openjdk 11 in docker testing (#10563)
- also fix javadoc warning when building on jdk11
2019-04-15 21:13:05 +01:00
João Duarte
dc5db673ee
build docker images from logstash repo (#10603)
introduces two rake tasks: `rake artifact:docker_oss` and `rake artifact:docker`, which will create the docker images of the OSS and non OSS packages. These tasks depend on the tar artifacts being built.

Also `rake artifact:all` has been modified to also call these two tasks.

most code was moved from https://github.com/elastic/logstash-docker/
2019-04-04 11:27:06 +01:00