scottyhardy / docker-wine

Docker image that includes Wine and Winetricks for running Windows applications on Linux and macOS
MIT License
907 stars 158 forks source link

How to run this docker-wine image using docker-compose file? #120

Open gonzalloe opened 2 years ago

gonzalloe commented 2 years ago

Hi, I was trying to build a stack of containers. One of them is the WINE container built using scottyhardy/docker-wine. Everything work great. But when I /bin/bash inside the WINE container, I can't start or run wine: bash: /usr/bin/wine: No such file or directory. The strange thing is wine64 work fine there: image

ls /usr/bin | grep wine wine is installed inside the container, but still file not found: image

Here is my docker-compose.yaml:

version: '3'
services:

  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: my_test/php_debian10
    container_name: app_PTV1
    restart: unless-stopped
    tty: true
    environment:
      APP_ENV: local
      CONTAINER_ROLE: app
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - app-network

  #Wine
  wine:
    image: scottyhardy/docker-wine
    container_name: wine_PTV1
    tty: true
    restart: always
    entrypoint: /bin/bash
    working_dir: /var/www
    networks:
      - app-network

 #Nginx Service
  webserver:
    image: nginx:alpine
    #container_name: webserver
    restart: unless-stopped
    tty: true
    volumes:
      - ./:/var/www
      - ./nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - app-network
    depends_on:
      - app

  #MySQL Service
  db:
    image: mysql:5.7.22
    container_name: db_PTV1
    restart: unless-stopped
    tty: true
    ports:
      - "3307:3306"
    environment:
      MYSQL_DATABASE: db
      MYSQL_ROOT_PASSWORD: passwrd
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    volumes:
      - dbdata:/var/lib/mysql/
      - ./mysql/my.cnf:/etc/mysql/my.cnf
    networks:
      - app-network

 #redis
  redis:
    image: redis:4.0
    container_name: redis_PTV1
    ports:
      - '8009:6379'
    volumes:
      - ./data/redis:/data
    networks:
      - app-network

  # Load balancer using HAProxy
  load_balancer:
    image: dockercloud/haproxy
    container_name: load_balancer_PTV1
    links:
        - webserver
    ports:
        - "85:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: unless-stopped
    networks:
      - app-network

#Docker Networks
networks:
  app-network:
    driver: bridge

#Volumes
volumes:
  dbdata:
    driver: local

Is there any configuration steps I missed? or the env setup needed?

scottyhardy commented 2 years ago

Hi @gonzalloe, I've tested with just a portion of your original config:

version: '3'
services:

  #Wine
  wine:
    image: scottyhardy/docker-wine
    container_name: wine_PTV1
    tty: true
    restart: always
    entrypoint: /bin/bash
    working_dir: /var/www

I was able to run wine without any issues:

Scotts-MacBook-Pro:test scottyhardy$ docker-compose up -d
Starting wine_PTV1 ... done
Scotts-MacBook-Pro:test scottyhardy$ docker exec -it wine_PTV1 /bin/bash
root@35ab2d3eee40:/var/www# wine
Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
       wine --help                   Display this help and exit
       wine --version                Output version information and exit
root@35ab2d3eee40:/var/www# wine --version
wine-6.0.2

I'm not sure if you were perhaps having issues with the particular build of the docker-wine image. I've recently made some updates that may have potentially fixed your problem, so would you mind testing again and let me know if you're still having issues?

gonzalloe commented 2 years ago

Sorry for late respond, the issue was solved after I reinstall my server OS. I guess it was some OS installation issues making Wine not working.

Thanks anyway.