Skip to content

Commit b7a069e

Browse files
committed
chore: Remove OnBuild variant
1 parent 6b3ebcd commit b7a069e

File tree

5 files changed

+11
-75
lines changed

5 files changed

+11
-75
lines changed

Dockerfile-onbuild.template

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ The official Node.js docker image, made with love by the node community.
2323
- [Image Variants](#image-variants)
2424
- [`node:<version>`](#nodeversion)
2525
- [`node:alpine`](#nodealpine)
26-
- [`node:onbuild`](#nodeonbuild)
2726
- [`node:slim`](#nodeslim)
2827
- [License](#license)
2928
- [Supported Docker versions](#supported-docker-versions)
@@ -191,49 +190,6 @@ image as a base, add the things you need in your own Dockerfile
191190
(see the [`alpine` image description](https://hub.docker.com/_/alpine/) for
192191
examples of how to install packages if you are unfamiliar).
193192

194-
### `node:onbuild`
195-
196-
The `ONBUILD` image variants are deprecated, and their usage is discouraged. For more details, see [docker-library/official-images#2076](https://github.com/docker-library/official-images/issues/2076).
197-
198-
This image makes building derivative images easier. For most use cases, creating
199-
a `Dockerfile` in the base of your project directory with the line `FROM
200-
node:onbuild` will be enough to create a stand-alone image for your project.
201-
202-
While the `onbuild` variant is really useful for "getting off the ground
203-
running" (zero to Dockerized in a short period of time), it's not recommended
204-
for long-term usage within a project due to the lack of control over *when* the
205-
`ONBUILD` triggers fire (see also
206-
[`docker/docker#5714`](https://github.com/docker/docker/issues/5714),
207-
[`docker/docker#8240`](https://github.com/docker/docker/issues/8240),
208-
[`docker/docker#11917`](https://github.com/docker/docker/issues/11917)).
209-
210-
Once you've got a handle on how your project functions within Docker, you'll
211-
probably want to adjust your `Dockerfile` to inherit from a non-`onbuild`
212-
variant and copy the commands from the `onbuild` variant `Dockerfile` (moving
213-
the `ONBUILD` lines to the end and removing the `ONBUILD` keywords) into your
214-
own file so that you have tighter control over them and more transparency for
215-
yourself and others looking at your `Dockerfile` as to what it does. This also
216-
makes it easier to add additional requirements as time goes on (such as
217-
installing more packages before performing the previously-`ONBUILD` steps).
218-
219-
This `onbuild` variant will only install npm packages according to the
220-
`package.json` and *does not* adhere to the `npm-shrinkwrap.json` (see full
221-
discussion in
222-
[`nodejs/docker-node#65`](https://github.com/nodejs/docker-node/issues/65).
223-
224-
Note that npm installs devDependencies by default, which is undesirable if
225-
you're building a production image. To avoid this pass NODE_ENV as a build
226-
argument i.e. `docker build --build-arg NODE_ENV=production …`.
227-
228-
The image assumes that your application has a file named
229-
[`package.json`](https://docs.npmjs.com/files/package.json) listing its
230-
dependencies and defining its [start
231-
script](https://docs.npmjs.com/misc/scripts#default-values).
232-
233-
It also assumes that you have a file named [`.dockerignore`](https://docs.docker.com/engine/reference/builder/#/dockerignore-file) otherwise it will copy your local npm modules:
234-
235-
`node_modules`
236-
237193
### `node:slim`
238194

239195
This image does not contain the common packages contained in the default tag and

architectures

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
bashbrew-arch variants
2-
amd64 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
3-
arm32v6 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
4-
arm32v7 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
5-
arm64v8 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
6-
i386 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
7-
ppc64le jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
8-
s390x jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11,onbuild
2+
amd64 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
3+
arm32v6 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
4+
arm32v7 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
5+
arm64v8 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
6+
i386 jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
7+
ppc64le jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11
8+
s390x jessie,jessie-slim,stretch,stretch-slim,buster,buster-slim,alpine3.9,alpine3.10,alpine3.11

test-build.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ set -euo pipefail
77
. functions.sh
88

99
# Convert comma delimited cli arguments to arrays
10-
# E.g. ./test-build.sh 8,10 slim,onbuild
11-
# "8,10" becomes "8 10" and "slim,onbuild" becomes "slim onbuild"
10+
# E.g. ./test-build.sh 10,12 slim,alpine
11+
# "10,12" becomes "10 12" and "slim,alpine" becomes "slim alpine"
1212
IFS=',' read -ra versions_arg <<< "${1:-}"
1313
IFS=',' read -ra variant_arg <<< "${2:-}"
1414

@@ -88,11 +88,6 @@ for version in "${versions[@]}"; do
8888
# Skip non-docker directories
8989
[ -f "${version}/${variant}/Dockerfile" ] || continue
9090

91-
if [ "${variant}" = "onbuild" ]; then
92-
build "${version}" "${default_variant}" "$tag"
93-
test_image "${full_version}" "${default_variant}" "$tag"
94-
fi
95-
9691
build "${version}" "${variant}" "${tag}"
9792
test_image "${full_version}" "${variant}" "${tag}"
9893
done

update.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function update_node_version() {
131131
(
132132
cp "${template}" "${dockerfile}-tmp"
133133
local fromprefix=""
134-
if [ "${arch}" != "amd64" ] && [ "${variant}" != "onbuild" ]; then
134+
if [ "${arch}" != "amd64" ]; then
135135
fromprefix="${arch}\\/"
136136
fi
137137

@@ -146,9 +146,6 @@ function update_node_version() {
146146
fi
147147
sed -Ei -e 's/^(ENV YARN_VERSION ).*/\1'"${yarnVersion}"'/' "${dockerfile}-tmp"
148148

149-
# Only for onbuild variant
150-
sed -Ei -e 's/^(FROM .*node:)[^-]*(-.*)/\1'"${nodeVersion}"'\2/' "${dockerfile}-tmp"
151-
152149
# shellcheck disable=SC1004
153150
new_line=' \\\
154151
'
@@ -248,7 +245,7 @@ for version in "${versions[@]}"; do
248245
template_file="${parentpath}/Dockerfile-alpine.template"
249246
fi
250247

251-
[ "$variant" != "onbuild" ] && cp "${parentpath}/docker-entrypoint.sh" "${version}/${variant}/docker-entrypoint.sh"
248+
cp "${parentpath}/docker-entrypoint.sh" "${version}/${variant}/docker-entrypoint.sh"
252249
if [ "${update_version}" -eq 0 ] && [ "${update_variant}" -eq 0 ]; then
253250
update_node_version "${baseuri}" "${versionnum}" "${template_file}" "${version}/${variant}/Dockerfile" "${variant}" &
254251
fi

0 commit comments

Comments
 (0)