2. Update the application
In part 2, you containerized a todo application. In this part, you will update the application image and corresponding container.
Update the source code¶
In the steps below, you will change the "empty text" when you don't have any todo list items to "You have no todo items yet! Add one above!"
-
In the
src/static/js/app.jsfile, update line 56 to use the new empty text. -
Build your updated version of the image, using the
klee buildcommand you used in part 2.
-
Start a new container using the updated code.
This will run a new instance of your app on another ip. Verify with jls:
$ jls
JID IP Address Hostname Path
6 10.13.37.1 /zroot/kleene/container/d23e37375ffd
12 10.13.37.2 /zroot/kleene/container/d43830c2e296
You can now verify that the todo app hosted on 10.13.37.2 is the updated version. Now, it's time to replace the old todo app with the updated one.
Remove the old container¶
To remove a container, you first need to stop it.
-
Get the ID of the container by using the
klee lsccommand. -
Use the
klee stopcommand to stop the container. Replace <the-container-id> with the ID fromklee lsc. -
Once the container has stopped, you can remove it by using the
klee rmccommand.
Repeat the last three steps to remove the updated container as well, and spin up a new container (step 3).
Note
You can stop and remove a container in a single command by adding the force flag to the klee rmc command. For example: klee rmc -f <the-container-id>
Start the updated app container¶
-
Now, start your updated app using the
klee runcommand from step 3 and the updated app can be accessed on the original IP10.13.37.1. -
Refresh your browser window from the previous chapter and see the updated text.

Next steps¶
While you were able to build an update, there were two things you might have noticed:
- All of the existing items in your todo list are gone! That's not a very good app! You'll fix that shortly.
- There were a lot of steps involved for such a small change. In the next section, you'll learn how to see code updates without needing to rebuild and start a new container every time you make a change.