# 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:
- Knative CLI Installation
- Pack CLI Installation (opens new window)
- Docker Installation (opens new window)
# Steps
clone the repo
$ git clone https://github.com/buildpacks/samples
go to the app directory
$ cd samples/apps/java-maven
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.
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)
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.