mirror of https://github.com/docker/docs.git
Fix python code snippet. (Commit containers) (#3267)
This commit is contained in:
parent
58434c1e4a
commit
4184049fbe
|
@ -622,7 +622,7 @@ Commit containers to create images from their contents:
|
||||||
```python
|
```python
|
||||||
import docker
|
import docker
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
container = client.run("alpine", ["touch", "/helloworld"], detached=True)
|
container = client.containers.run("alpine", ["touch", "/helloworld"], detach=True)
|
||||||
container.wait()
|
container.wait()
|
||||||
image = container.commit("helloworld")
|
image = container.commit("helloworld")
|
||||||
print image.id
|
print image.id
|
||||||
|
|
Loading…
Reference in New Issue