I don't know what is this docker image busybox:noauto
(probably your local image - build by you), and I guess this is reason of your problem. It's look like this image have some RUN
command with tail
or something like it.
I propose to use some standard busybox from dockerhub for your base image, for example busybox:1
:
FROM busybox:1
COPY /5sec.sh /5sec.sh
RUN chmod 777 5sec.sh
CMD ./5sec.sh
Second question you should use build
instead of image
in you docker-compose.yaml
if you want build image by yourself from your Dockerfile
:
version: '3'
services:
nginx:
image: "nginx:latest"
env_file: .env
ports:
- $HTTP_PORT:80
volumes:
- ./nginx-vol:/var/log/nginx
busybox:
build: .
volumes:
- ./nginx-vol:/var/log/nginx
This should solve your problem.
Notes:
chmod 777
isn't a good practice
- script should start with Shebang -
#!/bin/sh
in your case
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…