Running your application locally in a container (Linux)

Use a container for testing locally on a Linux server, to run the application in an environment that is similar to the production environment. The SDK creates a base image, which is identical to the base image that will run on the Guardium production environment.

Before you begin

To run the application on a Docker container, you must install Docker and start its service prior to installing the SDK. in order to run an app locally using Docker, you must either use sudo or run it using root. This is because the Docker daemon uses a socket, which by default is owned by root. This can be solved with what is described here: Docker Linux Post Install.

If you didn't install the Docker Toolbox, install it now on your development machine, see Docker Windows Install on Windows process, and reinstall the SDK. See Installing the SDK.

Verify that Docker is running.

Procedure

  1. After you create and run your application locally (Running your application locally), run the application locally using a Docker CentOS container by entering the command
    grd_sdk run -d -w <path to app>, for example
    grd_sdk run -d -w ./testapp.
    If your get permission errors, try
    sudo grd_sdk run -d -w <path to app>
  2. Open your browser and test https://127.0.0.1:5000/.
  3. To stop your application, press Ctrl+C.