@@ -200,12 +200,41 @@ $ docker service create --name redis \
200200
201201To grant a service access to multiple secrets, use multiple ` --secret ` flags.
202202
203- Secrets are located in ` /run/secrets ` in the container. If no target is
204- specified, the name of the secret will be used as the in memory file in the
205- container. If a target is specified, that will be the filename. In the
206- example above, two files will be created: ` /run/secrets/ssh ` and
203+ Secrets are located in ` /run/secrets ` in the container if no target is specified.
204+ If no target is specified, the name of the secret is used as the in memory file
205+ in the container. If a target is specified, that is used as the filename. In the
206+ example above, two files are created: ` /run/secrets/ssh ` and
207207` /run/secrets/app ` for each of the secret targets specified.
208208
209+ ### Create a service with configs
210+
211+ Use the ` --config ` flag to give a container access to a
212+ [ config] ( config_create.md ) .
213+
214+ Create a service with a config. The config will be mounted into ` redis-config ` ,
215+ be owned by the user who runs the command inside the container (often ` root ` ),
216+ and have file mode ` 0444 ` or world-readable. You can specify the ` uid ` and ` gid `
217+ as numerical IDs or names. When using names, the provided group/user names must
218+ pre-exist in the container. The ` mode ` is specified as a 4-number sequence such
219+ as ` 0755 ` .
220+
221+ ``` bash
222+ $ docker service create --name=redis --config redis-conf redis:3.0.6
223+ ```
224+
225+ Create a service with a config and specify the target location and file mode:
226+
227+ ``` bash
228+ $ docker service create --name redis \
229+ --config source=redis-conf,target=/etc/redis/redis.conf,mode=0400 redis:3.0.6
230+ ```
231+
232+ To grant a service access to multiple configs, use multiple ` --config ` flags.
233+
234+ Configs are located in ` / ` in the container if no target is specified. If no
235+ target is specified, the name of the config is used as the name of the file in
236+ the container. If a target is specified, that is used as the filename.
237+
209238### Create a service with a rolling update policy
210239
211240``` bash
0 commit comments