# Deploy an app from Source

In this quickstart tutorial you learn how to deploy an app from your local source code using pack.

The following tools have to be installed in order to perform the upcoming steps:

# Steps

  1. clone the repo

    $ git clone https://github.com/buildpacks/samples
    
  2. go to the app directory

    $ cd samples/apps/java-maven
    
  3. build the app

    $ pack build myapp --builder cnbs/sample-builder:bionic
    

    NOTE: This is your first time running pack build for myapp, so you’ll notice that the build might take longer than usual. Subsequent builds will take advantage of various forms of caching. If you’re curious, try running pack build myapp a second time to see the difference in build time.

  4. push the newly created image to an existing registry

    $ docker tag myapp:latest harbor.demo.kube-plus.cloud/demo/myapp
    $ docker push harbor.demo.kube-plus.cloud/demo/myapp
    
    Using default tag: latest
    The push refers to repository [harbor.demo.kube-plus.cloud/demo/myapp]
    83d85471d9f8: Pushed
    61059a6d1032: Pushed
    20e1cf6014bd: Pushed
    ffed268ea11e: Pushed
    a940b3489712: Pushed
    5933667ff857: Pushed
    444137a46fba: Pushed
    6babb56be259: Pushed
    latest: digest: sha256:b7bff5443e6bf48658308794b5a35a06760114b71bb506d002d30f8bb7bebf90 size: 1998
    

    NOTE: You can either bring your own registry or you can use our Harbor registry: https://harbor.demo.kube-plus.cloud. Click here for more information on how to use our Habor registry.

    or directly with pack --publish while building the image:

    $ pack build harbor.demo.kube-plus.cloud/demo/myapp \
      --builder paketobuildpacks/builder:base \
      --publish
    

    You should now be able to see the image in the on-cluster image registry: https://harbor.demo.kube-plus.cloud (opens new window)

  5. Execute the steps described in the Deploy an app from an image to deploy the newly created image with Knative.

    NOTE: In case you don't want to build your image locally, we also offer to use kpack which is an integral part of knative+. Here you can find more information about how to build your image on the cluster.

Last Updated: 6/2/2022, 8:41:31 AM