mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
Fix python code snippet. (Commit containers) (#3267)
This commit is contained in:
committed by
Misty Stanley-Jones
parent
58434c1e4a
commit
4184049fbe
@@ -622,7 +622,7 @@ Commit containers to create images from their contents:
|
||||
```python
|
||||
import docker
|
||||
client = docker.from_env()
|
||||
container = client.run("alpine", ["touch", "/helloworld"], detached=True)
|
||||
container = client.containers.run("alpine", ["touch", "/helloworld"], detach=True)
|
||||
container.wait()
|
||||
image = container.commit("helloworld")
|
||||
print image.id
|
||||
|
||||
Reference in New Issue
Block a user