Commit graph

3 commits

Author SHA1 Message Date
Andres Rodriguez
0605b75420
[docs] Correctly reference the base OS (ubuntu) for docker (#14214)
* Fix docs to correctly reference the base OS (ubuntu) for docker
2022-06-09 10:00:02 -04: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
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