Install as a Docker Container
Databases can be difficult to install. Docker can make it easy. To get some informal information, check out the .
You can install and configure
CA Live API Creatorto run as a Docker container.
Verify the Prerequisites
Ensure that you have completed the following prerequisites before installing
CA Live API Creatorto run as a Docker container:
- You have installed a recent version of Docker (1.11 or newer on Linux and 1.12.3 or later on Mac/Windows) and it is running properly.For more information about installing and running Docker, see the Docker documentation.To verify your Docker version and verify if Docker is running properly, run the following command from the command line:docker infoThe output gives you information about your version of Docker.If you get an error message, do not continue with installing and configuringCA Live API Creatorto run as a Docker container.
- You have decided which port you would like API Creator to run on. This installation assumes that that port is 8080, but you can change that to any port you want (as long as it is greater than 1024, less than 65535, and not already in use).
The One-minute Version
You can run
CA Live API Creatorin non-persistent mode using the one-minute version. This method starts a Docker container with
CA Live API Creatorrunning on top of Apache Tomcat, using Derby as the admin database and for its sample databases.
The Docker container does not remember anything, so do not invest too much time into it. Non-persistent mode is the simplest, but least powerful, way to run
CA Live API Creatoras a Docker container.
- Derby as an admin database is supported only for demonstration and proof of concept (POC) purposes. Using Derby as your admin database limits your ability to upgrade to the nextCA Live API Creatorrelease.
- Using Derby as your admin database is for advanced users.
- Limitations:CA Live API Creatorsupports Derby only in embedded mode. In this mode, Apache Derby does not support cluster configurations. Only one server can access the database at any given time.
- Issue the following command:docker run -p 8080:8080 caliveapicreator/3.1
- Start API Creator using the following URL in a browser:http://localhost:8080/APICreator
- Log in with user nameadmin, passwordPassword1.
You are logged in to API Creator and up and running.
Decide How you Want to Run the Container
You can run
CA Live API Creatoras a Docker container using the following deployment methods:
- Non-persistent mode.The Docker container does not remember anything. If you restart the container, any changes you have made, and any APIs you might have created, are forgotten. This is useful for quick demos, training, etc., or when you want a clean slate every time you start the image, and you do not plan to keep any changes.
- Persistent mode.The Docker container stores its information on the host's file system. If you restart the container, your changes are remembered. This deployment method is useful when usingCA Live API Creatorfor an extended period of time and you want to keep the changes you make.
- MySQL mode.The Docker container stores its information in a MySQL database, without any samples pre-installed. This is typically the mode used for production. You can use this deployment method in a cluster.
In all cases, if you want to avoid the End User License Agreement screen and having to accept the End User License Agreement when you first connect to
CA Live API Creator, you can start the Docker container using the following parameter:
docker run -p 8080:8080-e ca_accept_license=enucaliveapicreator/3.1
Run the Container in Non-Persistent Mode
You can run
CA Live API Creatoras a Docker container in non-persistent mode using the following methods:
- Start the Docker container. Issue the following command:docker run \ -p 8080:8080 \ caliveapicreator/3.1This command does not return and shows you the output of the container. This is usually helpful for diagnosing problems.
- Run the Docker container in the background. Issue the following command, adding the-doption:docker run \ -d \ -p 8080:8080 \ caliveapicreator/3.1
There are many other options when running
CA Live API Creatora Docker container.
For more information about these options, see the Docker documentation.
Run the Container in Persistent Mode
Decide where you want the Docker container to store its information. On Windows and Mac, the storage is in the Docker Machine, but you can share a directory between the host machine and the Docker Machine.
For more information about the Docker Machine, see the Docker documentation.
This procedure assumes the directory that you will use is
Issue the following command:
docker run \ -p 8080:8080 \ --volume=/home/docker/LiveAPICreator:/usr/local/CALiveAPICreator \ caliveapicreator/3.1
/home/docker/LiveAPICreatorpath is a default. You can change this path but this path should work in most cases. This directory is not deleted from the Docker Machine if you delete the
CA Live API CreatorDocker image. You must remove it. The first time you run the container in this mode, the following message appears:
Databases not found -- initializing with default
This message indicates that the repository was not found, and therefore a default repository was created, pre-loaded with two sample APIs.
Run the Container in MySQL Mode
When you run
CA Live API Creatoras a Docker container using this mode,
CA Live API Creatoruses a MySQL database as the admin database. You can provide your own MySQL database or you can use a pre-configured Docker container.
In this configuration, sample APIs are not created. You can change these options to use a pre-existing MySQL installation instead of a Docker container.
This procedure assumes that the directory you use to store the MySQL data is
/home/docker/lacadmin(this directory must exist in your Docker machine). You can specify a different directory, but it must be writable and the underlying disk must have enough free space.
- Start the MySQL Docker container by issuing the following command:docker run \ -e MYSQL_ROOT_PASSWORD=Password1 \ -e MYSQL_DATABASE=lacadmindb \ -e MYSQL_USER=lacadminuser \ -e MYSQL_PASSWORD=Password2 \ --volume=/home/docker/lacadmin:/var/lib/mysql \ -p 3306:3306 \ mysql:5.6.29Recent versions of MySQL should work, but MySQL 5.6.29 is known to work.The MySQL Docker container is now up and running. The startup process can take 10-20 seconds after the container is downloaded.
- StartCA Live API Creatoras a Docker container by issuing the following command:docker run \ -e RDS_HOSTNAME=127.0.0.1 \ -e RDS_PORT=3306 \ -e RDS_USERNAME=lacadminuser \ -e RDS_PASSWORD=Password2 \ -e RDS_DB_NAME=lacadmindb \ -e LAC_ADMIN_MAX_CONN=100 \ -p 8080:8080 \ caliveapicreator/3.1The Docker container can take a few seconds to start up.
Connect to API Creator
After the Docker container is up, connect to it from your Web browser:
By default, the user name is
adminand the password is
On initial login, you are asked to accept the End User License Agreement, unless you specified the following parameter on the command line when you started the Docker container:
Examine the Container
You can examine the Docker container (when it is running!).
- Issue the following command:docker ps
- Find the Docker container ID, for example:CONTAINER ID IMAGE COMMAND CREATED9376d7985de1 caliveapicreator/3.1 "catalina.sh run" 4 minutes ago
- Start a shell in the container by issuing the following command:docker exec -i -t 9376d7985de1 bashA command prompt appears. Tomcat runs in the/usr/local/tomcatdirectory. If you are runningCA Live API Creatoras a Docker container in non-persistent mode or persistent mode, the various Derby databases are in the/usr/local/CALiveAPICreator/databasesdirectory.
Stop and Reset your Container
If you want to stop your Docker container(s), complete the following:
The commands are in blue.
- Find the Docker container ID by issuing the following command:$ docker psThe following response is expected:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTSac7660d368e5 mysql:5.6.29 "/entrypoint.sh mysql" 31 seconds ago Up 30 seconds 3306/tcp 547911c7c2cc caliveapicreator/3.1 "StartLiveAPICreator." 7 minutes ago Up 7 minutes 0.0.0.0:8080->8080/tcp
- Complete one of the following:
- Stop the Docker container by issuing the following command:$docker stop547911c7c2cc
- Stop the Docker container permanently by issuing the following command:$docker rm547911c7c2cc
To wipe the Docker container out completely, complete the following:
- Find theCA Live API Creator's Docker image ID by issuing the following command:$ docker imagesThe following response is expected:REPOSITORY TAG IMAGE ID CREATED SIZEcaliveapicreator/3.1 latest 96b2a3d11452 2 days ago 580.4 MB mysql 5.6.29 cf859bd8ff7f 3 weeks ago 324.2 MB
- Remove the image by issuing the following command:$ docker rmi 96b2a3d11452
Databases can be difficult to install. Docker can make it easy. To get some informal information, check out the Tech Blog.