🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)
🕵️ SicherheitslückenWhat continuous operational resilience looks like under DORA(09.09.2026 um 17:53 Uhr)
🔧 AI Nachrichten OpenAI seeks tougher AI rules. CIOs may feel the ripple effects(10.09.2026 um 12:11 Uhr)
🔧 AI Nachrichten Mistral valued at €21bn after €3bn Series D funding round(08.09.2026 um 10:19 Uhr)
🪟 Windows TippsWindows XP's Cursor Indicator Is Getting a Windows 11 Refresh(25.08.2026 um 13:00 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 10 Min Lesezeit
0

1minDocker #13 - Push, build and dockerize with GitHub Actions

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

In the and register there with your email and password. You will be asked also to create an username

  • Activating 2 factors authentication ( if you don't have it)




    CODE
    git clone https://github.com/username/hello-world-docker-github
    # Remember to change 'username' with your actual username!
    cd hello-world-docker-github/






    And now, let's create and start editing our app.py file (.py is the extension that python scripts have):




    CODE
    touch app.py
    code app.py






    The touch command creates the file, whereas the code command opens the file within Visual Studio Code (a IDE, Integrated Development Environment) to modify it. You can obviously use different IDEs: no IDE is better than another one, as long as it works for you.



    Generally, a "hello world" application prints "Hello world!" on the terminal, like this:




    CODE
    print("Hello world!")






    But we want to do something more: we don't like vanilla white text on our terminal, we want some 🌈color🌈.



    To do this, we simply need to install the .



    Once the change is pushed, you will see, on your online GitHub repo, a brown dot: it means that the workflow we triggered with our push is now working and will build and push the image. If the workflow run is successful, you will see a green tick at the end of it, whereas if it fails, you will see a red cross.



    Make sure that, once the package is created, it is public: if not, change its visibility to public, otherwise you won't be able to download it.






    Testing - Trying our app



    As we said, the Docker image will be loaded as a package under ghcr.io; we can then pull and run the image like this:




    CODE
    docker pull ghcr.io/username/hello-world-github-docker:main
    docker run -t ghcr.io/username/hello-world-github-docker:main






    If Docker says that it can't pull the image because you are not logged in to the GitHub Container Registry, you can simply run:




    CODE
    docker login ghcr.io -u username -p GITHUB-ACCESS-TOKEN






    And this should do the magic!



    When we run our application, we should see a colored "Hello world!" printed on the terminal.






    Modifying our application



    Now, let's say that we want to let the user choose the color they want "Hello world" to be printed with. We can modify our app.py like this:




    CODE
    from termcolor import cprint

    colors = ["red", "green", "blue", "magenta", "yellow"]

    # Tell the user the instructions
    print(f"Hello user! What color would you like 'Hello world' to be printed with?\nChoose among: {', '.join(colors)}")

    # Take the input from the user
    color = input("-->")

    # Check if the input is in the available colors: if not, tell the user that it is not available
    if color.lower() in colors:
    cprint("Hello world!", color=color)
    else:
    print("ERROR! The color you chose is not among the available colors :(")






    To modify the Docker image, it is now sufficient to add, commit and push the local changes to the online repo:




    CODE
    git add .
    git commit -m "user defined color"
    git push origin main






    If the workflow run is successful again, we should be able to pull and run the new image with updated features:




    CODE
    docker pull ghcr.io/username/hello-world-github-docker:main
    docker run -it ghcr.io/username/hello-world-github-docker:main






    We will stop here for this article, but in the next one we will see, hands-on, how to use Docker for on-cloud deployments: stay tuned and have fun!🥰

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
  • Wie bewertest du diesen Beitrag?
    1 Klick Feedback
    Teilen mit Netzwerk & Team:

    Community-Analysen & Experten-Meinungen 0

    Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
    Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
    Community Pulse: Relevanz-Einschätzung
    1 Klick Experten-Votum
    🔴 Akute Relevanz 0%
    🟡 In Evaluierung 0%
    🟢 Keine Auswirkung 0%
    Spannende Innovation 0%
    Verwandte Story-Cluster & Quellen (Vektor-KI)
    Port 8095 Engine
    1 Quelle
    Sam Altman calls GPT-6 Astra rollout ‘messy’ as enterprise users wait for access
    1 Quelle
    Swiss government explores replacing Microsoft 365 with open-source software
    1 Quelle
    What continuous operational resilience looks like under DORA
    Ähnliche Beiträge
    🔍 Verwandte News

    Auch interessante Nachrichten 1minDocker #13 - Push, build and dockerize with GitHub Actions

    Thematisch verwandte Begriffe: 1minDocker, Push, build, dockerize · 6 Treffer

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...

    Laden...

    Beiträge werden geladen ...

    Laden...

    Videos werden geladen ...