Skip to content

Commit

Permalink
Remove *-onbuild images.
Browse files Browse the repository at this point in the history
Onbuild images are deemed as 'useful but confusing'.

Rather than produce onbuild images, projects should consider providing
example Dockerfiles for consumers to use for reference.

Almost all official Docker Hub project have removed their onbuilds now.

Ref: docker-library/official-images#2076
Ref: docker-library/docs@3823017

Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
Lee Jones committed Nov 16, 2018
1 parent b30bb77 commit 9196208
Show file tree
Hide file tree
Showing 55 changed files with 19 additions and 1,719 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ services:

env:
- Dockerfile=v0.12/alpine
- Dockerfile=v0.12/alpine-onbuild
- Dockerfile=v0.12/debian
- Dockerfile=v0.12/debian-onbuild
- Dockerfile=v1.2/alpine
- Dockerfile=v1.2/alpine-onbuild
- Dockerfile=v1.2/debian
- Dockerfile=v1.2/debian-onbuild

before_script:
- make image DOCKERFILE=$Dockerfile VERSION=test
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fluent/fluentd:v0.12-onbuild
FROM fluent/fluentd:v0.12
MAINTAINER YOUR_NAME <...@...>

RUN apk add --update --virtual .build-deps \
Expand All @@ -13,4 +13,7 @@ RUN apk add --update --virtual .build-deps \
&& rm -rf /var/cache/apk/* \
/home/fluent/.gem/ruby/2.3.0/cache/*.gem

COPY fluent.conf /fluentd/etc/
COPY entrypoint.sh /bin/

EXPOSE 24284
6 changes: 0 additions & 6 deletions Dockerfile.template.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<% fluentd_ver = version.split("-").first[1..-1] %>
<% is_onbuild = (version.split("-").last == "onbuild") %>
<% is_alpine = (dockerfile.split("/").last.split("-").first == "alpine") %>
<% is_armhf = (dockerfile.split("/")[1] == "armhf") %>
<% is_windows = (dockerfile.split("/").last.split("-").first == "windows") %>
Expand Down Expand Up @@ -163,11 +162,6 @@ COPY entrypoint.sh /bin/
RUN chmod +x /bin/entrypoint.sh
<% end %>

<% if is_onbuild %>
ONBUILD COPY fluent.conf /fluentd/etc/
ONBUILD COPY plugins /fluentd/plugins/
<% end %>

ENV FLUENTD_OPT=""
ENV FLUENTD_CONF="fluent.conf"

Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@
IMAGE_NAME := fluent/fluentd
X86_IMAGES := \
v0.12/alpine:v0.12.43,v0.12 \
v0.12/alpine-onbuild:v0.12.43-onbuild,v0.12-onbuild \
v0.12/debian:v0.12.43-debian,v0.12-debian \
v0.12/debian-onbuild:v0.12.43-debian-onbuild,v0.12-debian-onbuild \
v1.2/alpine:v1.2.6,v1.2,edge,stable,latest \
v1.2/alpine-onbuild:v1.2.6-onbuild,v1.2-onbuild,edge-onbuild,stable-onbuild,onbuild \
v1.2/debian:v1.2.6-debian,v1.2-debian,edge-debian,stable-debian,debian \
v1.2/debian-onbuild:v1.2.6-debian-onbuild,v1.2-debian-onbuild,edge-debian-onbuild,stable-debian-onbuild,debian-onbuild \
v1.2/windows:v1.2.6-windows,stable-windows,windows
# <Dockerfile>:<version>,<tag1>,<tag2>,...

# Define images for running on ARM platforms
ARM_IMAGES := \
v1.2/armhf/debian:v1.2.6-debian-armhf,v1.2-debian-armhf,edge-debian-armhf,stable-debian-armhf,debian-armhf \
v1.2/armhf/debian-onbuild:v1.2.6-debian-armhf-onbuild,v1.2-debian-armhf-onbuild,edge-debian-armhf-onbuild,stable-debian-armhf-onbuild,debian-armhf-onbuild \
v1.2/armhf/alpine:v1.2.6-alpine-armhf,v1.2-alpine-armhf,edge-alpine-armhf,stable-alpine-armhf,alpine-armhf \
v1.2/armhf/alpine-onbuild:v1.2.6-alpine-armhf-onbuild,v1.2-alpine-armhf-onbuild,edge-alpine-armhf-onbuild,stable-alpine-armhf-onbuild,alpine-armhf-onbuild

ALL_IMAGES := $(X86_IMAGES) $(ARM_IMAGES)

Expand Down
45 changes: 15 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,12 @@ Fluentd Docker Image

- `v0.12.43`, `v0.12`
[(v0.12/alpine/Dockerfile)][101]
- `v0.12.43-onbuild`, `v0.12-onbuild`
[(v0.12/alpine-onbuild/Dockerfile)][102]
- `v0.12.43-debian`, `v0.12-debian`
[(v0.12/debian/Dockerfile)][105]
- `v0.12.43-debian-onbuild`, `v0.12-debian-onbuild`
`debian-onbuild`
[(v0.12/debian-onbuild/Dockerfile)][106]
- `v1.2.6`, `v1.2`, `edge`, `stable`, `latest`
[(v1.2/alpine/Dockerfile)][113]
- `v1.2.6-onbuild`, `v1.2-onbuild`, `edge-onbuild`, `stable-onbuild`, `onbuild`
[(v1.2/alpine-onbuild/Dockerfile)][114]
- `v1.2.6-debian`, `v1.2-debian`, `edge-debian`, `stable-debian`, `debian`
[(v1.2/debian/Dockerfile)][115]
- `v1.2.6-debian-onbuild`, `v1.2-debian-onbuild`, `edge-debian-onbuild`, `v1.1-debian-onbuild`, `stable-debian-onbuild`,
[(v1.2/debian-onbuild/Dockerfile)][116]


We recommend to use debian version for production because it uses jemalloc to mitigate memory fragmentation issue.
Expand Down Expand Up @@ -100,8 +91,6 @@ This image is based on the popular [Alpine Linux project][1], available in
Alpine Linux is much smaller than most distribution base images (~5MB), and
thus leads to much slimmer images in general.

Since `v0.12.26`, tags are separated into `vX.Y.Z` and `vX.Y.Z-onbuild`.

### `stable`, `latest`

Latest version of stable Fluentd branch (currently `v1.0`).
Expand All @@ -118,12 +107,6 @@ Latest version of `vX.Y` Fluentd branch.

Concrete `vX.Y.Z` version of Fluentd.

### `onbuild`, `xxx-onbuild`

This image makes building derivative images easier.
See ["How to build your own image"](#how-to-build-your-own-image) section for
more details.

### `debian`

The image based on [Debian Linux image][7].
Expand All @@ -138,14 +121,14 @@ Furthermore, the base images enable support for cross-platform builds using the

In order to build these images natively on ARM devices, the `CROSS_BUILD_START` and `CROSS_BUILD_END` Docker build arguments must be set to the shell no-op (`:`), for example:
```bash
docker build --build-arg CROSS_BUILD_START=":" --build-arg CROSS_BUILD_END=":" -t fluent/fluentd:v1.2.6-onbuild v1.2/armhf/alpine-onbuild
docker build --build-arg CROSS_BUILD_START=":" --build-arg CROSS_BUILD_END=":" -t fluent/fluentd:v1.2.6 v1.2/armhf/alpine
```
(assuming the command is run from the root of this repository).

## How to build your own image

You can build a customized image based on Fluentd's `onbuild` image.
Customized image can include plugins and `fluent.conf` file.
You can build a customized image based on the supplied `Dockerfile.sample` template.
Customized image can include plugins and `fluent.conf` file (See 'COPY' instructions).


### 1. Create a working directory
Expand All @@ -160,8 +143,8 @@ cd custom-fluentd

# Download default fluent.conf. This file will be copied to the new image.
# VERSION is v0.12 or v0.14 like fluentd version and OS is alpine or debian.
# Full example is https://raw.githubusercontent.com/fluent/fluentd-docker-image/master/v0.12/debian-onbuild/fluent.conf
curl https://raw.githubusercontent.com/fluent/fluentd-docker-image/master/VERSION/OS-onbuild/fluent.conf > fluent.conf
# Full example is https://raw.githubusercontent.com/fluent/fluentd-docker-image/master/v0.12/debian/fluent.conf
curl https://raw.githubusercontent.com/fluent/fluentd-docker-image/master/VERSION/OS/fluent.conf > fluent.conf

# Create plugins directory. plugins scripts put here will be copied to the new image.
mkdir plugins
Expand All @@ -183,8 +166,8 @@ To add plugins, edit `Dockerfile` as following:
##### Alpine version

```Dockerfile
# or v1.0-onbuild
FROM fluent/fluentd:v0.12-onbuild
# or v1.0
FROM fluent/fluentd:v0.12

# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish
Expand All @@ -197,13 +180,16 @@ RUN apk add --update --virtual .build-deps \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
/home/fluent/.gem/ruby/2.4.0/cache/*.gem

COPY fluent.conf /fluentd/etc/
COPY entrypoint.sh /bin/
```

##### Debian version

```Dockerfile
# or v1.0-debian-onbuild
FROM fluent/fluentd:v0.12-debian-onbuild
# or v1.0-debian
FROM fluent/fluentd:v0.12-debian

# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish
Expand All @@ -220,6 +206,9 @@ RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev" \
$buildDeps \
&& rm -rf /var/lib/apt/lists/* \
/home/fluent/.gem/ruby/2.3.0/cache/*.gem

COPY fluent.conf /fluentd/etc/
COPY entrypoint.sh /bin/
```

##### Note
Expand Down Expand Up @@ -290,10 +279,6 @@ through a [GitHub issue](https://github.com/fluent/fluentd-docker-image/issues).
[6]: https://docs.docker.com/engine/reference/logging/fluentd
[7]: https://hub.docker.com/_/debian
[101]: https://github.com/fluent/fluentd-docker-image/blob/master/v0.12/alpine/Dockerfile
[102]: https://github.com/fluent/fluentd-docker-image/blob/master/v0.12/alpine-onbuild/Dockerfile
[105]: https://github.com/fluent/fluentd-docker-image/blob/master/v0.12/debian/Dockerfile
[106]: https://github.com/fluent/fluentd-docker-image/blob/master/v0.12/debian-onbuild/Dockerfile
[113]: https://github.com/fluent/fluentd-docker-image/blob/master/v1.2/alpine/Dockerfile
[114]: https://github.com/fluent/fluentd-docker-image/blob/master/v1.2/alpine-onbuild/Dockerfile
[115]: https://github.com/fluent/fluentd-docker-image/blob/master/v1.2/debian/Dockerfile
[116]: https://github.com/fluent/fluentd-docker-image/blob/master/v1.2/debian-onbuild/Dockerfile
55 changes: 0 additions & 55 deletions v0.12/alpine-onbuild/Dockerfile

This file was deleted.

27 changes: 0 additions & 27 deletions v0.12/alpine-onbuild/entrypoint.sh

This file was deleted.

33 changes: 0 additions & 33 deletions v0.12/alpine-onbuild/fluent.conf

This file was deleted.

15 changes: 0 additions & 15 deletions v0.12/alpine-onbuild/hooks/post_push

This file was deleted.

Loading

0 comments on commit 9196208

Please sign in to comment.