I’m trying to configure sendy to run on docker-compose. I’m getting this error when running docker-compose up
error
JavaScript
x
Building sendy
Traceback (most recent call last):
File "compose/cli/main.py", line 67, in main
File "compose/cli/main.py", line 126, in perform_command
File "compose/cli/main.py", line 1070, in up
File "compose/cli/main.py", line 1066, in up
File "compose/project.py", line 615, in up
File "compose/service.py", line 362, in ensure_image_exists
File "compose/service.py", line 1147, in build
compose.service.BuildError: (<Service: sendy>, {'message': 'failed to parse Dockerfile: file with no instructions'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 78, in main
TypeError: can only concatenate str (not "dict") to str
[83327] Failed to execute script docker-compose
docker-compose.yml
JavaScript
version: "3.7"
# Volumes for persisted data.
volumes:
data_sendy:
labels:
co.sendy.description: "Data volume for Sendy Database."
# Secret files so they're not exposed via 'docker inspect'
secrets:
db_password:
file: secrets/db_password.txt
db_root_password:
file: secrets/db_root_password.txt
services:
# Database: MySQL
db_sendy:
hostname: db_sendy
container_name: db_sendy
image: mysql:5.6
env_file:
- sendy.env
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
secrets:
- db_root_password
- db_password
volumes:
- data_sendy:/var/lib/mysql
# WebApp: Apache2+PHP+Sendy
sendy:
hostname: sendy
container_name: sendy
depends_on:
- db_sendy
image: bubbajames/sendy:4.1
build:
context: .
# Uncomment to enabled XDEBUG build
# target: debug
env_file:
- sendy.env
secrets:
- db_password
ports:
- 8080:80
# Load Balancer: HAProxy
load-balancer:
hostname: lb_sendy
container_name: lb_sendy
image: lb_sendy
build:
context: .
dockerfile: haproxy/Dockerfile
env_file:
- sendy.env
ports:
- 80:80
- 443:443
Advertisement
Answer
In the directory where that docker-compose file exists, is there a Dockerfile specifically called “Dockerfile“?
Under your sendy service, you have the context as the current directory, but no Dockerfile specified. By default, it will look for a file called “Dockerfile” at that location.