Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Extract version from tag
id: version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
.tws-version
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ WORKDIR /home/docker

USER docker
COPY --from=builder /root/install-ibgateway.sh install-ibgateway.sh
RUN printf "/home/docker/Jts/1030\nn" | ./install-ibgateway.sh
RUN printf "/home/docker/Jts/tws\nn" | ./install-ibgateway.sh \
&& ls /home/docker/Jts/tws/jars/twslaunch-*.jar | grep -oE '[0-9]+' | head -1 > /home/docker/.tws-version

RUN mkdir .vnc \
&& x11vnc -storepasswd password .vnc/passwd
Expand All @@ -48,10 +49,10 @@ COPY --from=builder /opt/ibc /opt/ibc
COPY --from=builder /root/run.sh run.sh
COPY ibc_config.ini ibc/config.ini

ENV DISPLAY :0
ENV TRADING_MODE paper
ENV TWS_PORT 4002
ENV VNC_PORT 5900
ENV DISPLAY=:0
ENV TRADING_MODE=paper
ENV TWS_PORT=4002
ENV VNC_PORT=5900

EXPOSE $TWS_PORT
EXPOSE $VNC_PORT
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
VERSION := v$(shell grep -o 'Jts/[0-9]*' Dockerfile | cut -d'/' -f2)-ibc$(shell grep -o 'IBCLinux-[0-9.]*' Dockerfile | sed 's/IBCLinux-//' | sed 's/\.$$//')
TWS_VERSION = $(shell cat .tws-version 2>/dev/null)
IBC_VERSION = $(shell grep -o 'IBCLinux-[0-9.]*' Dockerfile | sed 's/IBCLinux-//' | sed 's/\.$$//')
VERSION = v$(TWS_VERSION)-ibc$(IBC_VERSION)

vnc: up
open vnc://localhost:5900

build:
docker-compose build ib-gateway
@docker run --rm martinffx/ib-gateway-docker cat /home/docker/.tws-version > .tws-version

up:
docker-compose up -d ib-gateway
Expand Down
Loading