How to run Acuitas in a Docker container

Installation Instructions for Linux

For Windows, scroll down….

Pre-requisite:

Docker is installed.

if not, get it from https://docs.docker.com/install/linux/docker-ce/ubuntu/

Verify if docker is up and running

docker run hello-world

You should get the response “Hello from Docker!”

Step 1: Fetch the Acuitas build files

The latest acuitas version as of document is v1.1.0-Beta15. Please check the discord channel to ensure you are fetching the latest version.

wget https://aqs-bot-builds.sfo2.digitaloceanspaces.com/tradebot-v1.1.0-beta15.zip

Unzip the file

unzip tradebot-v1.1.0-beta15.zip 

I am going to rename the unzipped folder as acuitas 

mv tradebot-v1.1.0-beta15 acuitas

Step 2: Create Acuitas Dockerfile

Create a file with the following contents and name it exactly as Dockerfile 

Note: if you name the file as anything else, the subsequent steps will fail

FROM adoptopenjdk:11-jre-hotspot

CMD ["java","-XX:+DisableAttachMechanism","-jar","/acuitas/tradebot-Server-v1.1.0-581.jar","port=2112"]

Contents of file

Contents of our current directory will now look like this 

Step 3: Create the Acuitas Docker Image

docker build -t aqs .

This builds the image required to run Acuitas Docker container.

Step 4: Run Acuitas Docker Container

docker run -p 2112:2112 -d --rm -v "$(pwd)"/acuitas:/acuitas aqs

if all went well, you should now be able to open up a browser and access acuitas
Open up a browser and navigate to
http://localhost:2112/

Installation Instructions for Windows

Windows 10 

Step 1) Install Docker Desktop community edition for windows from

https://hub.docker.com/editions/community/docker-ce-desktop-windows

If all is well, then do a test by running the following command in powershell.

docker run hello-world

You should get back a greeting from docker “Hello from Docker!”

Step 2) Download and extract Acuitas zip file contents to C:\acuitas .

Please check the discord channel for the latest version link.

https://aqs-bot-builds.sfo2.digitaloceanspaces.com/tradebot-v1.1.0-beta15.zip

Step 3) Create a Dockerfile in this folder with the following contents.

FROM adoptopenjdk:11-jre-hotspot

CMD ["java","-XX:+DisableAttachMechanism","-jar","/acuitas/tradebot-Server-v1.1.0-581.jar","port=2112"]

Step 4) Create the Acuitas Docker Image

Open up powershell, navigate to C:\acuitas and type the following command

docker build -t aqs .

You can verify that the image is built succesfully by issuing the following command

docker images

Step 5) Run Acuitas Container

docker run -p 2112:2112 -d --rm -v c:/acuitas:/acuitas aqs

You will get a prompt like this , click Yes

And another one like this 

Moment of truth. Open up a browser and navigate to

http://localhost:2112

A few things to note:

1) You will be able to see the running docker container by issuing the command docker ps -a Name of the acuitas docker container is aqs

2) The db & log files will be available in the acuitas folder, since we have mapped our local folder “acuitas” in the current directory as a mapped volume in the container.

3) If a new version of acuitas is released, perform the following steps

  • a) Identify the running acuitas container ID by running docker ps -a
  • b) then issue docker stop CONTAINERID
  • d) replace the contents of the local folder acuitas with the newly downloaded zip file
  • Some upgrades only need the jar file to be replaced. Some require a db reset. refer the release notes to know more.
  • e) For Linux start the container withe command docker run -p 2112:2112 -d --rm -v "$(pwd)"/acuitas:/acuitas aqs
  • f) For Windows start the container with the command docker run -p 2112:2112 -d --rm -v c:/acuitas:/acuitas aqs

4) Since we are supplying the –rm parameter while starting the container, if the acuitas process dies inside the container for any reason, the container would be removed as well. If you dont want this to happen, remove the –rm param. I left it on, because the log files are anyway on our local folder to troubleshoot and start a new container. If you remove –rm , remember to remove the container i.e, docker rm CONTAINERID before attempting to start a new one with the same name aqs.



Add a comment