You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/images-create-guide-openshift.adoc
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,19 @@
7
7
The following are guidelines that apply when creating container images specifically
8
8
for use on {product-title}.
9
9
ifdef::openshift-online[]
10
-
[discrete]
10
+
11
+
[id="privileges-and-volume-builds_{context}"]
11
12
== Privileges and volume builds
12
13
13
14
Container images cannot be built using the `VOLUME` directive in the `DOCKERFILE`. Images using a read/write file system must use persistent volumes or `emptyDir` volumes instead of local storage. Instead of specifying a volume in the Dockerfile, specify a directory for local storage and mount either a persistent volume or `emptyDir` volume to that directory when deploying the pod.
For images that are intended to run application code provided by a third party, such as a Ruby image designed to run Ruby code provided by a developer, you can enable your image to work with the link:https://github.com/openshift/source-to-image[Source-to-Image (S2I)] build tool. S2I is a framework that makes it easy to write images that take application source code as an input and produce a new image that runs the assembled application as output.
20
21
21
-
[discrete]
22
+
22
23
[id="use-uid_{context}"]
23
24
== Support arbitrary user ids
24
25
@@ -52,7 +53,6 @@ If your S2I image does not include a `USER` declaration with a numeric user, you
52
53
====
53
54
endif::[]
54
55
55
-
[discrete]
56
56
[id="use-services_{context}"]
57
57
== Use services for inter-image communication
58
58
@@ -62,12 +62,11 @@ For cases where your image needs to communicate with a service provided by anoth
62
62
For more information see https://kubernetes.io/docs/concepts/services-networking/service/[this documentation]. (NOTE to docs team: this link should really go to something in the openshift docs once we have it)
63
63
////
64
64
65
-
[discrete]
65
+
[id="provide-common-libraries_{context}"]
66
66
== Provide common libraries
67
67
68
68
For images that are intended to run application code provided by a third party, ensure that your image contains commonly used libraries for your platform. In particular, provide database drivers for common databases used with your platform. For example, provide JDBC drivers for MySQL and PostgreSQL if you are creating a Java framework image. Doing so prevents the need for common dependencies to be downloaded during application assembly time, speeding up application image builds. It also simplifies the work required by application developers to ensure all of their dependencies are met.
69
69
70
-
[discrete]
71
70
[id="use-env-vars_{context}"]
72
71
== Use environment variables for configuration
73
72
@@ -92,31 +91,31 @@ in containers:
92
91
- Blog article - http://fabiokung.com/2014/03/13/memory-inside-linux-containers[Memory inside Linux containers]
93
92
////
94
93
95
-
[discrete]
94
+
[id="set-image-metadata_{context}"]
96
95
== Set image metadata
97
96
98
97
Defining image metadata helps {product-title} better consume your container images, allowing {product-title} to create a better experience for developers using your image. For example, you can add metadata to provide helpful descriptions of your image, or offer suggestions on other images that are needed.
99
98
100
-
[discrete]
99
+
[id="clustering_{context}"]
101
100
== Clustering
102
101
103
102
You must fully understand what it means to run multiple instances of your image. In the simplest case, the load balancing function of a service handles routing traffic to all instances of your image. However, many frameworks must share information to perform leader election or failover state; for example, in session replication.
104
103
105
104
Consider how your instances accomplish this communication when running in {product-title}. Although pods can communicate directly with each other, their IP addresses change anytime the pod starts, stops, or is moved. Therefore, it is important for your clustering scheme to be dynamic.
106
105
107
-
[discrete]
106
+
[id="logging_{context}"]
108
107
== Logging
109
108
110
109
It is best to send all logging to standard out. {product-title} collects standard out from containers and sends it to the centralized logging service where it can be viewed. If you must separate log content, prefix the output with an appropriate keyword, which makes it possible to filter the messages.
111
110
112
111
If your image logs to a file, users must use manual operations to enter the running container and retrieve or view the log file.
113
112
114
-
[discrete]
113
+
[id="liveness-and-readiness-probes_{context}"]
115
114
== Liveness and readiness probes
116
115
117
116
Document example liveness and readiness probes that can be used with your image. These probes allow users to deploy your image with confidence that traffic is not be routed to the container until it is prepared to handle it, and that the container is restarted if the process gets into an unhealthy state.
118
117
119
-
[discrete]
118
+
[id="templates_{context}"]
120
119
== Templates
121
120
122
121
Consider providing an example template with your image. A template gives users an easy way to quickly get your image deployed with a working configuration. Your template must include the liveness and readiness probes you documented with the image, for completeness.
0 commit comments