Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #5687
| From | Stefan Fuhrmann <stefan@fuhrmann.homedns.org> |
|---|---|
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] docker module |
| Date | 2020-10-08 07:48 +0200 |
| Message-ID | <mailman.1264.1602136139.9580.python-de@python.org> (permalink) |
| References | <dc9ec5eb-0138-f63d-2fa2-52c275916139@fuhrmann.homedns.org> <9a9430bc-a4ff-a24c-80aa-a87ca879db22@fuhrmann.homedns.org> |
Moin,
pull geht, Da hat mein IDS in die Suppe gespuckt.
Was nicht geht ist zB
print(image.id)
oder
print(container.id)
File "./test.py", line 14, in <module>
print(container.id)
Woran liegts?
Danke!
Gruß
Stefan
Am 07.10.20 um 14:10 schrieb Stefan Fuhrmann:
> Hallo zusammen,
>
>
> ich bin Programier- und Python Anfänger.
>
> Momentan befinde ich mich in einer 4 wöchigen python Schulung und als
> Abschlussarbeit, nächste Woche, möchte ich gerne
>
> nextcloud für Kunden mit python deployen. Meine Vorstellung: ich habe
> ein docker-compose template und passe hier die Pade für Kunden an,
> Passwörter setzen, eigenes Netz....
>
> Nun habe ich die docker docs gefunden um das python module zu
> bedienen. Dies will mir aber nicht so recht gelingen.
>
> https://docs.docker.com/engine/api/sdk/examples/
>
> hier ist ein Reiter: python
>
> Das ist aber wohl python 2. Okay, auch wenn ich versuche hier
> anzupassen und ein einfaches pull mache, passiert nicht viel. Es
> werden mir beide Container IDs angezeigt, die ich laufen habe und das
> wars.
>
> #!/usr/bin/python3
> 2
> 3 import subprocess
> 4 import shutil
> 5 import os
> 6 import docker
> 7 client = docker.from_env()
> 8 import sys
> 9 print(sys.version)
> 10
> 11 print(client.containers.list())
> 12 #print(image.id)
> 13 #print("df:" ,client.containers(df()))
> 14 #print(client.containers.list()[0].logs())
> 15 image = client.images.pull("alpine")
> 16 print("download abgeschloassen: ")
> 17 print(image.id)
>
> Wenn ich den herkömmlichen weg gehe und ein pull auf "hello world"
> mache, funktioniert alles einwandfrei.
>
> Was mache ich falsch? Oder gibt es eine besser Anlaufstelle die
> besser, aktueller dokumentiert ist?
>
>
> Kann jemand helfen?
>
> Danke!
>
> Gruß
>
> Stefan
>
>
> _______________________________________________
> python-de maillist - python-de@python.org
> https://mail.python.org/mailman/listinfo/python-de
Back to de.comp.lang.python | Previous | Next | Find similar
Re: [Python-de] docker module Stefan Fuhrmann <stefan@fuhrmann.homedns.org> - 2020-10-08 07:48 +0200
csiph-web