mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
docs: Docker driver supports task user option
Also, add a test case.
This commit is contained in:
@@ -1009,6 +1009,23 @@ func TestDockerDriver_CreateContainerConfig(t *testing.T) {
|
||||
require.Equal(t, containerName, c.Name)
|
||||
}
|
||||
|
||||
func TestDockerDriver_CreateContainerConfig_User(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
task, cfg, _ := dockerTask(t)
|
||||
task.User = "random-user-1"
|
||||
|
||||
require.NoError(t, task.EncodeConcreteDriverConfig(cfg))
|
||||
|
||||
dh := dockerDriverHarness(t, nil)
|
||||
driver := dh.Impl().(*Driver)
|
||||
|
||||
c, err := driver.createContainerConfig(task, cfg, "org/repo:0.1")
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, task.User, c.Config.User)
|
||||
}
|
||||
|
||||
func TestDockerDriver_CreateContainerConfig_Labels(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -413,6 +413,8 @@ The `docker` driver supports the following configuration in the job spec. Only
|
||||
* `pids_limit` - (Optional) An integer value that specifies the pid limit for
|
||||
the container. Defaults to unlimited.
|
||||
|
||||
Additionally, docker driver supports customization of the container user through task [`user` option](/docs/job-specification/task.html#user).
|
||||
|
||||
### Container Name
|
||||
|
||||
Nomad creates a container after pulling an image. Containers are named
|
||||
|
||||
Reference in New Issue
Block a user