Step 6: Run the application
Packaging System Demo
Now that the build is complete, let's test it out by running the package. Two common ways of running a package include:
- Start services directly from the Studio* using the Chef Habitat Supervisor, or
- Export the .hart to a Docker image and use docker run.
We've mentioned the benefits of Chef Habitat's export capabilities, so let's see how how that works now. With a single command, you will have exported the .hart file as a Docker image.
After the export finishes, exit the studio (or open a new terminal window in the same location) and run the Docker container.
*On some operating systems, the Chef Habitat Studio runs as Docker container, so if you wanted to view a sample application running within a Studio, you'd need to expose a port using one of Chef Habitat's environment variables.
Preview the application in your browser
Finally, go to http://localhost:8000 in your browser to see the sample application UI (screenshot below).