Skip to content

Instantly share code, notes, and snippets.

@shau-lok
Created May 24, 2018 02:23
Show Gist options
  • Save shau-lok/05b1a9a42d72c769424417751eef01f1 to your computer and use it in GitHub Desktop.
Save shau-lok/05b1a9a42d72c769424417751eef01f1 to your computer and use it in GitHub Desktop.
Docker Error : standard_init_linux.go:178: exec user process caused "exec format error"

docker-compose 启动服务,需要用到脚本启动的情况

脚本的头部必须加上 #!/bin/bash

eg:

docker-compose

version: '2'

services:

 redis:
   image: redis:latest
   hostname: redis

 web:
   build:
     context: .
     dockerfile: Dockerfile
   hostname: web
   restart: always
   command: ./deploy/run_web.sh
   volumes:
     - .:/app
     - /opt/config/collection/.env:/app/.env
     - /opt/logs/collection:/app/logs
   links:
     - redis
   ports:
     - 5001:5000

/deploy/run_web.sh

#!/bin/bash
gunicorn run:app --log-level=info --workers=4 --timeout=600 --worker-class=gevent --bind=0.0.0.0:5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment