Skip to content

Instantly share code, notes, and snippets.

@Shubhamhirau18
Forked from vfarcic/87-docker-multi-stage.sh
Created October 22, 2021 18:40
Show Gist options
  • Save Shubhamhirau18/4e2b63516b9d0d9aaa5afa1570baf06a to your computer and use it in GitHub Desktop.
Save Shubhamhirau18/4e2b63516b9d0d9aaa5afa1570baf06a to your computer and use it in GitHub Desktop.

Revisions

  1. @vfarcic vfarcic revised this gist Jun 6, 2021. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions 87-docker-multi-stage.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Source: https://gist.github.com/da48772c54dcf09a45bef5d4d778a6e9

    ###################################
    # Using Docker Multi-Stage Builds #
    # https://youtu.be/zpkqNPwEzac #
    @@ -6,16 +8,12 @@
    # Referenced videos:
    # - Kaniko - Building Container Images In Kubernetes Without Docker: https://youtu.be/EgwVQN6GNJg
    # - Skaffold - How to Build and Deploy In Kubernetes: https://youtu.be/qS_4Qf8owc0
    # - GitHub CLI - How to manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc

    #########
    # Setup #
    #########

    # Watch https://youtu.be/BII6ZY2Rnlc if you are not familiar with GitHub CLI

    gh repo fork vfarcic/docker-multistage-demo \
    --clone
    git clone https://github.com/vfarcic/docker-multistage-demo.git

    cd docker-multistage-demo

  2. @vfarcic vfarcic created this gist Jun 6, 2021.
    53 changes: 53 additions & 0 deletions 87-docker-multi-stage.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    ###################################
    # Using Docker Multi-Stage Builds #
    # https://youtu.be/zpkqNPwEzac #
    ###################################

    # Referenced videos:
    # - Kaniko - Building Container Images In Kubernetes Without Docker: https://youtu.be/EgwVQN6GNJg
    # - Skaffold - How to Build and Deploy In Kubernetes: https://youtu.be/qS_4Qf8owc0
    # - GitHub CLI - How to manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc

    #########
    # Setup #
    #########

    # Watch https://youtu.be/BII6ZY2Rnlc if you are not familiar with GitHub CLI

    gh repo fork vfarcic/docker-multistage-demo \
    --clone

    cd docker-multistage-demo

    #####################
    # Simple Dockerfile #
    #####################

    cat Dockerfile-simple

    docker image build --tag demo \
    --file Dockerfile-simple .

    ##################
    # Fat Dockerfile #
    ##################

    cat Dockerfile-fat

    docker image build --tag demo \
    --file Dockerfile-fat .

    docker image build --tag demo \
    --file Dockerfile-fat .

    docker image list

    #################################
    # Multi-stage Dockerfile builds #
    #################################

    cat Dockerfile

    docker image build --tag demo .

    docker image list