Closed ulises2k closed 2 years ago
seems like groovy is no longer supported
I fix with this:
ulises2k@BANGHO:~/docker-metatrader$ cat Dockerfile
# Run MetaTrader in a container.
#
# Copyright (c) 2021 tick <tickelton@gmail.com>
#
# SPDX-License-Identifier: ISC
#
# docker run \
# --net host \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# -e DISPLAY \
# -v $METATRADER_HOST_PATH:/MetaTrader \
# --name mt \
# tickelton/mt
# Base docker image.
FROM ubuntu:focal
ADD https://dl.winehq.org/wine-builds/winehq.key /winehq.key
# Install Wine
RUN apt-get update && \
apt-get install -y gnupg apt-utils && \
echo "deb http://dl.winehq.org/wine-builds/ubuntu/ focal main" >> /etc/apt/sources.list && \
apt-key add /winehq.key && \
mv /winehq.key /usr/share/keyrings/winehq-archive.key && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y -q --install-recommends winehq-devel && \
rm -rf /var/lib/apt/lists/* /winehq.key
# Add wine user.
# NOTE: You might need to change the UID/GID so the
# wine user has write access to your MetaTrader
# directory at $METATRADER_HOST_PATH.
RUN groupadd -g 1000 wine \
&& useradd -g wine -u 1000 wine \
&& mkdir -p /home/wine/.wine && chown -R wine:wine /home/wine
# Run MetaTrader as non privileged user.
USER wine
# Autorun MetaTrader Terminal.
ENTRYPOINT [ "wine" ]
CMD [ "/MetaTrader/terminal64.exe", "/portable" ]
New Dockerfile Fix timezone
ulises2k@BANGHO:~/docker-metatrader$ cat Dockerfile
# Run MetaTrader in a container.
#
# Copyright (c) 2021 tick <tickelton@gmail.com>
#
# SPDX-License-Identifier: ISC
#
# docker run \
# --net host \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# -e DISPLAY \
# -v $METATRADER_HOST_PATH:/MetaTrader \
# --name mt \
# tickelton/mt
# Base docker image.
FROM ubuntu:focal
ADD https://dl.winehq.org/wine-builds/winehq.key /winehq.key
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Helsinki
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install Wine
RUN apt-get update && \
apt-get install -y gnupg apt-utils && \
echo "deb http://dl.winehq.org/wine-builds/ubuntu/ focal main" >> /etc/apt/sources.list && \
apt-key add /winehq.key && \
mv /winehq.key /usr/share/keyrings/winehq-archive.key && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y -q --install-recommends winehq-devel && \
rm -rf /var/lib/apt/lists/* /winehq.key
# Add wine user.
# NOTE: You might need to change the UID/GID so the
# wine user has write access to your MetaTrader
# directory at $METATRADER_HOST_PATH.
RUN groupadd -g 1000 wine \
&& useradd -g wine -u 1000 wine \
&& mkdir -p /home/wine/.wine && chown -R wine:wine /home/wine
# Run MetaTrader as non privileged user.
USER wine
# Autorun MetaTrader Terminal.
ENTRYPOINT [ "wine" ]
CMD [ "/MetaTrader/terminal64.exe", "/portable" ]
Using Kali Linux WSL. Docker Desktop last version
ulises2k@BANGHO:~$ git clone https://github.com/tickelton/docker-metatrader Cloning into 'docker-metatrader'... remote: Enumerating objects: 23, done. remote: Counting objects: 100% (22/22), done. remote: Compressing objects: 100% (16/16), done. remote: Total 23 (delta 7), reused 18 (delta 5), pack-reused 1 Receiving objects: 100% (23/23), 6.42 KiB | 822.00 KiB/s, done. Resolving deltas: 100% (7/7), done. ulises2k@BANGHO:~$ mkdir MetaTrader ulises2k@BANGHO:~$ cp -r /mnt/c/temp/MetaTrader-MT5/* MetaTrader/ ulises2k@BANGHO:~$ cd MetaTrader/ ulises2k@BANGHO:~/MetaTrader$ ls Bases Config help metaeditor64.exe metatester64.exe MQL5 Profiles Sounds terminal64.exe Terminal.ico ulises2k@BANGHO:~/MetaTrader$ cd ulises2k@BANGHO:~$ cd docker-metatrader/ ulises2k@BANGHO:~/docker-metatrader$ docker build . [+] Building 62.3s (8/9) => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.23kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for docker.io/library/ubuntu:groovy 25.3s => [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s => https://dl.winehq.org/wine-builds/winehq.key 0.0s => [1/4] FROM docker.io/library/ubuntu:groovy@sha256:a7b08558af07bcccca994b01e1c84f1d14a2156e0099fcf7fcf73f52d082791e 22.8s => => resolve docker.io/library/ubuntu:groovy@sha256:a7b08558af07bcccca994b01e1c84f1d14a2156e0099fcf7fcf73f52d082791e 0.0s => => sha256:32f3531c8415258308e8d8dda886004bc90cdf4793f9b97c6f33e7903036294f 31.34MB / 31.34MB 13.1s => => sha256:a7b08558af07bcccca994b01e1c84f1d14a2156e0099fcf7fcf73f52d082791e 1.42kB / 1.42kB 0.0s => => sha256:754eb641a1ba98a8b483c3595a14164fa4ed7f4b457e1aa05f13ce06f8151723 529B / 529B 0.0s => => sha256:e508bd6d694ef622f1f5628104de30be6b58fc6c3c489f62e271b2d6f424a582 1.46kB / 1.46kB 0.0s => => extracting sha256:32f3531c8415258308e8d8dda886004bc90cdf4793f9b97c6f33e7903036294f 6.9s => [2/4] ADD https://dl.winehq.org/wine-builds/winehq.key /Release.key 6.9s => ERROR [3/4] RUN apt-get update && apt-get install -y gnupg apt-utils && echo "deb http://dl.winehq.org/wine-builds/ubuntu/ groovy main" >> /etc/apt/sou 6.6s