Docker Community Forums

Share and learn in the Docker community.

Container command work on MAC but not work on WINDOW

docker

(Minhbkpro) #1

I need some help please. I’m new to docker.

I need to run cakephp 1.3.2 on docker.

Here is my docker-compose file:

version: '2'

services:
  mysql:
    image: mysql:5.7
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=cakephp-1.3

  nginx:
    depends_on:
      - phpfpm
    image: nginx
    ports:
      - "8910:80"
    restart: always
    working_dir: /var/www
    volumes:
      - .:/var/www
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf

  phpfpm:
    image: php:5.4-fpm
    restart: always
    working_dir: /var/www
    ports:
      - "8080:80"
    volumes:
      - .:/var/www
    depends_on:
      - mysql

On my MAC:
I start docker by “docker-compose up -d”, console output like this:

Starting cakephp-13_mysql_1 ... done
Starting cakephp-13_phpfpm_1 ... done
Starting cakephp-13_nginx_1  ... done

Now i need to check if “cake” command work inside cakephp-13_phpfpm_1 container:

docker exec cakephp-13_phpfpm_1 cake/console/cake

it show

TERM environment variable not set.

Welcome to CakePHP v1.3.20 Console
---------------------------------------------------------------
Current Paths:
 -app: app
 -working: /var/www/app
 -root: /var/www
 -core: /var/www

Changing Paths:
your working path should be the same as your application path
to change your path use the '-app' param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:
tput: No value for $TERM and no -T specified
 acl [CORE]
 api [CORE]
 bake [CORE]
 console [CORE]
 i18n [CORE]
 schema [CORE]
 testsuite [CORE]

To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'

mean it work!

ON WINDOW 10
when i put my project over git then other member (window 10) pull git and run exactly same commands. When i run:

docker exec cakephp-13_phpfpm_1 cake/console/cake

it show

: No such file or directory

Why this can not work on window 10 and how to fix ?

Both window 10 and mac installed Docker CE Lastest version for now.

Someone help me please!