manhinhang / futu-opend-docker

lightweight futu opend docker
MIT License
6 stars 1 forks source link
docker futu trading trading-api

Futu OpenD Docker

Docker Pulls GitHub

lightweight futu opend docker

Pull the docker image from docker hub

# default base image is ubuntu
docker pull manhinhang/futu-opend-docker:ubuntu-stable

container tags pattern

Base Image Tags
ubuntu ubuntu-stable
ubuntu ubuntu-beta
ubuntu ubuntu-{opend_version}
centos centos-stable
centos centos-beta
centos centos-{opend_version}

Create a container from the image and run it

You need to create FutuOpenD.xml file generate your own RSA key

openssl genrsa -out futu.pem 1024

PEM file should config in xml

...
<rsa_private_key>/bin/futu.pem</rsa_private_key>
...
docker run -it \
-v $(pwd)/FutuOpenD.xml:/bin/FutuOpenD.xml \
-v $(pwd)/futu.pem:/bin/futu.pem \
-p 11111:11111 \
manhinhang/futu-opend-docker

Input 2FA code

  1. Attach to futu opend continer
docker attach futu-opend-docker
  1. Input received SMS passcode
input_phone_verify_code -code=<2FA_CODE>

Run in docker compose

Edit .env

Enviroment Variable Description
FUTU_ACCOUNT_ID Futu account id
FUTU_ACCOUNT_PWD Futu account password
FUTU_RSA_FILE_PATH Futu RSA file path in container
FUTU_OPEND_IP Futu OpenD IP in container
FUTU_OPEND_PORT Futu OpenD Port in container
docker compose up -d

Then enter 2FA code

docker attach futu-opend
input_phone_verify_code -code=<2FA_CODE>

Build locally

docker build -t futu-opend-docker --build-arg FUTU_OPEND_VER=7.1.3308 --build-arg BASE_IMG=ubuntu .
docker build -t futu-opend-docker --build-arg FUTU_OPEND_VER=7.1.3308 --build-arg BASE_IMG=centos .

Disclaimer

This project is not affiliated with Futu Securities International (Hong Kong) Limited.

Good luck and enjoy.