Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Zorro on Linux in a Docker container #459278
05/04/16 18:42
05/04/16 18:42
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
For anyone interested in Docker, I wrote a Dockerfile for putting Zorro and MT4 in a Docker container. It's a bit incomplete since I don't think I can distribute pre-installed MT4 but you can see it here anyway. I'm using this to run Z3, Z7 and Z12 on a dedicated Linux server.

If anyone's really interested in this I'll alter the startup script to download and run the installers the first time you run it. That way it should work pretty painlessly.

Last edited by Veratyr; 05/04/16 18:43.
Re: Zorro on Linux in a Docker container [Re: Veratyr] #459279
05/04/16 18:57
05/04/16 18:57
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks Veratyr! I know nothing about Docker, but am interested in Zorro on Linux. laugh A couple of questions:

Why Wine vs. VM (VirtualBox or KVM or other)?

When Zorro or MT4 (if used) is updated, what would the update process be?

Thanks!

Re: Zorro on Linux in a Docker container [Re: DdlV] #459280
05/04/16 19:09
05/04/16 19:09
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
Originally Posted By: DdlV
Why Wine vs. VM (VirtualBox or KVM or other)?


A VM is much heavier than a container. In a container, Zorro costs me about 200M of RAM and 20% of a CPU core per instance, since I'm running Zorro, MT4 a VNC server and nothing else. Running Windows 7 requires at least 1GB of RAM and enough CPU to deal with all the services it insists on running. Plus you need to buy Windows licenses.

Originally Posted By: DdlV
When Zorro or MT4 (if used) is updated, what would the update process be?


I think MT4 updates itself but I'm not sure. Zorro would have to be updated manually at the moment. I'm not even sure how you're meant to update Zorro normally. If people really care I might put in environment variables that select the broker software to install and whether to setup Zorro from scratch or not.

Re: Zorro on Linux in a Docker container [Re: Veratyr] #459281
05/04/16 21:37
05/04/16 21:37
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Ah - I see - this is only for Trading developed strategies.

Developing, Testing, & Training is a different ball game using lots more resources...

For Trading, I think a Windows VPS works better for me...

Thanks.

Re: Zorro on Linux in a Docker container [Re: DdlV] #459282
05/04/16 22:31
05/04/16 22:31
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Quote:
Plus you need to buy Windows licenses.

On virtualizations via Hyper-V you can license processors of the host system only. So e.g. Strato can offer Windows vservers for EUR 7,50/month that's less than a Windows license even in SPLA.

Re: Zorro on Linux in a Docker container [Re: Veratyr] #459284
05/05/16 02:46
05/05/16 02:46
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline
Member
Mithrandir77  Offline
Member

Joined: Nov 2013
Posts: 123
Thanks a lot Veratyr! Great idea! But there is something that I don't get, you upload the docker file to a linux vps ? May I know what vps are you using?

Also although I have used docker files for a mooc in deep learning I don't quite understand some of the steps

-In step 3) and 4)
Quote:

3) Run docker build -t zorro .. This builds the Docker image.

4) Run docker run -i -t -d -p <port>:5901 -v <zorro location>:/opt/zorro:z --name zorro --restart=always zorro. should be the location of your Zorro install (the folder that contains Zorro.exe).


In step 3 I don't understand how you involve wine.tar.gz and Dockerfile in the creation of the docker image and where do I put xstartup and start.sh files

In step 4 I don't understand what placeholder you mean to replace with zorro location, is it something like this -assuming zorro is installed in /usr/local - ?

docker run -i -t -d -p 127.0.0.1:80:5901 -v /usr/local:/opt/zorro:z --name zorro --restart=always

Concerning VNC, do you use it to connect to the docker or to connect to the linux vps where the docker is?

Sorry if any question is dumb!

Re: Zorro on Linux in a Docker container [Re: Mithrandir77] #459285
05/05/16 04:45
05/05/16 04:45
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
Originally Posted By: DdlV
Ah - I see - this is only for Trading developed strategies.

Developing, Testing, & Training is a different ball game using lots more resources...

For Trading, I think a Windows VPS works better for me...

Thanks.


That's what I intended it for but it's certainly usable for development and training. Unlike a VPS it gets full direct access to the CPU, which may be an advantage.

Originally Posted By: Mithrandir77
Thanks a lot Veratyr! Great idea! But there is something that I don't get, you upload the docker file to a linux vps ? May I know what vps are you using?


The Dockerfile needs to be built on a machine that has Docker available. A Linux VM is probably the easiest but you can install Docker on Mac or Windows as well. I'm using a dedicated server running Fedora from OVH myself.

Originally Posted By: Mithrandir77
In step 3 I don't understand how you involve wine.tar.gz and Dockerfile in the creation of the docker image and where do I put xstartup and start.sh files

In step 4 I don't understand what placeholder you mean to replace with zorro location, is it something like this -assuming zorro is installed in /usr/local - ?


The Dockerfile is basically a script that tells Docker how to build an image. It makes them more maintainable and stuff. The xstartup and start.sh files just need to be left next to the Dockerfile (if you git clone the repository they're in the right place by default). wine.tar.gz is extracted into the image when you build Docker. I used it to install MetaTrader once but it may be worth just removing the line from the Dockerfile if you're not using MT4.

The Zorro location placeholder should be replaced with the path to a Zorro installation, that is, a directory containing Zorro.exe, Scripts folder etc.

I didn't really package this cleanly since I wasn't sure how much interest it'd get so it's probably a terrible introduction to Docker.

Re: Zorro on Linux in a Docker container [Re: Veratyr] #459305
05/05/16 21:39
05/05/16 21:39
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline
Member
Mithrandir77  Offline
Member

Joined: Nov 2013
Posts: 123
Well, I tried installing MT4 with Wine in linux and I couldn't, first it asked for a proxy which I solved following this but then it downloaded all the files but it failed at the end. So I just copied the MT4 folder in Program Files (x86) in my Windows 7 to /home/user/.wine/drive_c/Program Files (x86) in my Ubuntu VM

and positioned in /home/user I use it in terminal:

tar czf wine.tar.gz .wine

Installed docker, reboot

But when trying to execute step 2) executing docker build -t zorro . inside dockerZorro folder
Code:
user@user-VirtualBox:~/Downloads/dockerZorro$ dir
Dockerfile  README.md  start.sh  wine.tar.gz  xstartup



The script got stucked in Running in ca639d2772ca
Code:
user@user-VirtualBox:~/Downloads/dockerZorro$ docker build -t zorro .
Sending build context to Docker daemon 217.5 MB
Step 1 : FROM fedora:23
23: Pulling from library/fedora
a3ed95caeb02: Pull complete 
236608c7b546: Pull complete 
Digest: sha256:008c29c39619425de93eee20100661bef85a3f4fe0eaaf5b33532f615ccc2cd7
Status: Downloaded newer image for fedora:23
 ---> ddd5c9c1d0f2
Step 2 : MAINTAINER ME
 ---> Running in f05a6f32d00d
 ---> 9bc600b64778
Removing intermediate container f05a6f32d00d
Step 3 : RUN dnf install -y wine tigervnc-server xorg-x11-server-Xvfb openbox xorg-x11-xinit tmux xorg-x11-utils xdotool tar gzip unzip && dnf clean all
 ---> Running in ca639d2772ca



I have zorro folder with Zorro.exe, etc in Downloads, does it have to be inside dockerZorro in my case? Or is there something else wrong?

Code:
user@user-VirtualBox:~/Downloads$ dir
dockerZorro  icmarkets4setup.exe  mt4setup.exe	winetricks  zorro


Last edited by Mithrandir77; 05/05/16 22:14.
Re: Zorro on Linux in a Docker container [Re: Mithrandir77] #459307
05/06/16 05:05
05/06/16 05:05
Joined: Jan 2016
Posts: 122
V
Veratyr Offline OP
Member
Veratyr  Offline OP
Member
V

Joined: Jan 2016
Posts: 122
Quote:
/home/user/.wine/drive_c/Program Files (x86)

]

It has to be /root/.wine and it has to be owned by root, as the user inside the container is root. You might not have to install it as root but when you compress it, it has to be there. If you're not using MT4 though you might be better off just removing it.

Quote:
The script got stucked in Running in ca639d2772ca


How fast is your internet connection? It's downloading a lot of packages so if your connection is slow it might take a while.

Quote:
I have zorro folder with Zorro.exe, etc in Downloads


It doesn't matter where the Zorro folder is, as long as it's on the computer that's running Docker.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1