Skip to content

Commit 7de4d5f

Browse files
authored
Merge pull request #5059 from ahardin-rh/more-docker-build-cleaning
Removed Docker build references from Online docs
2 parents 264469d + a423357 commit 7de4d5f

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

creating_images/guidelines.adoc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,16 @@ operations.
9292
You can prevent the `yum` cache from ending up in an image layer by creating
9393
your `RUN` statement as follows:
9494

95-
====
96-
9795
----
9896
RUN yum -y install mypackage && yum -y install myotherpackage && yum clean all -y
9997
----
100-
====
10198

10299
Note that if you instead write:
103100

104-
====
105-
106101
----
107102
RUN yum -y install mypackage
108103
RUN yum -y install myotherpackage && yum clean all -y
109104
----
110-
====
111105

112106
Then the first `yum` invocation leaves extra files in that layer, and these
113107
files cannot be removed when the `yum clean` operation is run later. The extra
@@ -138,29 +132,24 @@ For example, if you are working on a *_Dockerfile_* that contains an `ADD`
138132
command to install a file you are iterating on, and a `RUN` command to `yum
139133
install` a package, it is best to put the `ADD` command last:
140134

141-
====
142135

143136
----
144137
FROM foo
145138
RUN yum -y install mypackage && yum clean all -y
146139
ADD myfile /test/myfile
147140
----
148-
====
149141

150142
This way each time you edit *_myfile_* and rerun `docker build`, the system reuses
151143
the cached layer for the `yum` command and only generates the new layer for the
152144
`ADD` operation.
153145

154146
If instead you wrote the *_Dockerfile_* as:
155147

156-
====
157-
158148
----
159149
FROM foo
160150
ADD myfile /test/myfile
161151
RUN yum -y install mypackage && yum clean all -y
162152
----
163-
====
164153

165154
Then each time you changed *_myfile_* and reran `docker build`, the `ADD`
166155
operation would invalidate the `RUN` layer cache, so the `yum` operation would
@@ -318,14 +307,15 @@ if ! whoami &> /dev/null; then
318307
fi
319308
----
320309

321-
For a complete example of this, see
322310
ifdef::openshift-origin[]
323-
link:https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/Dockerfile.centos7[this Dockerfile]
311+
For a complete example of this, see
312+
link:https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/Dockerfile.centos7[this Dockerfile].
324313
endif::[]
325314
ifdef::openshift-enterprise[]
326-
link:https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/Dockerfile[this Dockerfile]
315+
For a complete example of this, see
316+
link:https://github.com/RHsyseng/container-rhel-examples/blob/master/starter-arbitrary-uid/Dockerfile[this Dockerfile].
327317
endif::[]
328-
.
318+
329319

330320
Lastly, the final *USER* declaration in the `Dockerfile` should specify the user
331321
ID (numeric value) and not the user name. This allows {product-title} to

creating_images/s2i_testing.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ useful, but it provides a good starting point to begin developing.
6767
====
6868
The *_test/run_* script produced by the `s2i create` command requires that the sample application sources are inside the *_test/test-app_* directory.
6969
====
70-
70+
ifndef::openshift-online[]
7171
[[testing-locally]]
7272

7373
== Testing Locally
7474
The easiest way to run the S2I image tests locally is to use the generated
75-
*_Makefile_*. If you did not use the `s2i create` command, you can copy the
75+
*_Makefile_*.
76+
77+
If you did not use the `s2i create` command, you can copy the
7678
following *_Makefile_* template and replace the `*IMAGE_NAME*` parameter with
7779
your image name.
7880

@@ -140,7 +142,7 @@ verify that saving and restoring artifacts works properly.
140142
Executing these steps is generally enough to tell if the builder image is
141143
working as expected.
142144

143-
ifndef::openshift-online[]
145+
144146
[[using-openshift-build-for-automated-testing]]
145147

146148
== Using {product-title} Build for Automated Testing

dev_guide/builds/advanced_build_operations.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ the image or introduce vulnerabilities that can be exploited.
133133
To avoid these problems, two builds can be chained together: one that produces
134134
the compiled artifact, and a second build that places that artifact in a
135135
separate image that runs the artifact.
136-
136+
ifndef::openshift-online[]
137137
In the following example, a
138138
xref:../../architecture/core_concepts/builds_and_image_streams.adoc#source-build[Source-to-Image]
139139
build is combined with a
@@ -262,7 +262,7 @@ whenever the first build is run and produces a new image with the binary
262262
artifact, the second build is automatically triggered to produce a runtime image
263263
that contains that artifact. Therefore, both builds behave as a single build
264264
with two stages.
265-
265+
endif::[]
266266
[[build-pruning]]
267267
== Build Pruning
268268

0 commit comments

Comments
 (0)