Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #5687
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Stefan Fuhrmann <stefan@fuhrmann.homedns.org> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] docker module |
| Date | Thu, 8 Oct 2020 07:48:56 +0200 |
| Lines | 88 |
| 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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.uni-berlin.de /MennYfPZLm4yRObR8F6vAMdxC1Hc9hppiTDyO+UnQuw== |
| Return-Path | <stefan@fuhrmann.homedns.org> |
| X-Original-To | python-de@python.org |
| Delivered-To | python-de@mail.python.org |
| Authentication-Results | mail.python.org; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy); dkim-atps=neutral |
| X-Virus-Scanned | Debian amavisd-new at willy.nopanicsystems.net |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
| In-Reply-To | <dc9ec5eb-0138-f63d-2fa2-52c275916139@fuhrmann.homedns.org> |
| Content-Language | en-US |
| X-BeenThere | python-de@python.org |
| X-Mailman-Version | 2.1.34 |
| Precedence | list |
| List-Id | Die Deutsche Python Mailingliste <python-de.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-de/> |
| List-Post | <mailto:python-de@python.org> |
| List-Help | <mailto:python-de-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <9a9430bc-a4ff-a24c-80aa-a87ca879db22@fuhrmann.homedns.org> |
| X-Mailman-Original-References | <dc9ec5eb-0138-f63d-2fa2-52c275916139@fuhrmann.homedns.org> |
| Xref | csiph.com de.comp.lang.python:5687 |
Show key headers only | View raw
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