Questions tagged [docker-entrypoint]
180 questions
0
votes
1 answer
Docker : Run apache with www-data user but execute script as root at launch
I want to secure a Docker image based on php-apache.
My Dockerfile uses a bash script as entrypoint were the minimum rights are given to www-data user to run apache. The rights are given with setfacl, and setfacl rules are not persisted in docker…

Mdstn
- 31
- 3
0
votes
0 answers
How to run a script in docker-compose start process without overriding ENTRYPOINT or CMD of Docker Image?
I want to start my docker container with a docker-compose command.
The underlying docker image CMD should just be executed regularly, and I want to append my script at some point.
When reading about executing shell commands in docker, entrypoint is…

ricklepick
- 1
- 2
0
votes
1 answer
Docker entrypoint returns different results from running script manually
I have a container that runs an SQL query and then sends an email based on the results.
#!/bin/bash
AMOUNT=$(mysql -h foo -u foo -pfoo foo < order-check.sql | sed 's/amount//'| cut -f1 -d ".")
if [ $AMOUNT -eq 0 ]
then
sendmail foo@bar.com <…

Ydrab
- 21
- 1
- 5
0
votes
0 answers
Overriding entrypoint with new executable file fails in docker
I am trying to override the entrypoint of an image with a new executable as follows
Everything runs from github actions step FWIW
- name: run docker
run: |
ls -l
docker run \
-v…

pkaramol
- 16,451
- 43
- 149
- 324
0
votes
3 answers
How to execute some task in background within a docker container
I'm trying to perform some user operation(change admin-user), after Neo4j container boots up. But my background script doesn't wait for the neo4j to come up and dies before Neo4j comes online.
entrypoint.sh is something like
if [some condition]
…

Amit G
- 186
- 1
- 11
0
votes
1 answer
Is it possible to use shell processing to parse environment variables while specifying a non-shell entrypoint in docker?
What I am trying to achieve
Background information
I have a docker container set up with environmental variables pre-defined by Kubernetes and used as configuration for the docker container.
In the Dockerfile, these are meant to be read and passed…

SSHUser
- 3
- 2
0
votes
1 answer
docker entrypoint running in loop
I am new to Docker and trying to adapt a setup from Symfony Docker to another app that uses a different Dockerfile.
I use a docker-entrypoint to run database migrations which, of course, require the database to be up.
My Dockerfile calls…

BernardA
- 1,391
- 19
- 48
0
votes
1 answer
Container date won't update in entrypoint script
I built a container using the docker-compose script below:
services:
client:
image: alpine
environment:
- BACKUP_ENABLED=1
- BACKUP_INTERVAL=60
- BACKUP_PATH=/data
- BACKUP_FILENAME=db_backup
networks:
-…

gonzalloe
- 313
- 3
- 7
- 22
0
votes
1 answer
How do I pass an env/build arg from my docker-compose script to a Dockerfile ENTRYPOINT command?
I want to pass an env/build var to my Dockerfile for use in its entryxoint and thought I could do it from the docker-compose file like so
web:
restart: "no"
build:
context: ../my-project
args:
CURRENT_ENV:…

Dave
- 15,639
- 133
- 442
- 830
0
votes
2 answers
Run Shell script in docker using Environment variable
I am running a docker file to execute a debezium service as entrypoint.
It works fine and executes debezium service when I use the exact file path as parameter to Entrypoint command in my docker file
command in docker file
ENTRYPOINT…

FlashUltron
- 161
- 1
- 2
- 6
0
votes
2 answers
How do I get a docker container to automatically execute a bash script once it starts up?
I'm stuck trying to achieve the objective described in the title. Tried various options last of which is found in this article. Currently my Dockerfile is as follows:
FROM ubuntu:18.04
EXPOSE 8081
CMD cd /var/www/html/components
CMD "bash myscript…

user1729972
- 712
- 2
- 9
- 29
0
votes
0 answers
how to run echo Hello World when just starting a container
I have a docker file as below:
FROM kong
USER 0
RUN mkdir -p /kong/declarative/
COPY declarative/kong.yml /kong/declarative/
# COPY docker-entrypoint.sh /docker-entrypoint.sh
# RUN ["chmod", "+x", "/docker-entrypoint.sh"]
# ENTRYPOINT…

Amin Ba
- 1,603
- 1
- 13
- 38
0
votes
1 answer
Docker entrypoint script not sourcing file
I have an entrypoint script with docker which is getting executed. However, it just doesn't run the source command to source a file full of env values.
Here's the relevant section from tehe dockerfile
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD…

usert4jju7
- 1,653
- 3
- 27
- 59
0
votes
1 answer
docker-compose service build path not found
I have a rake task in my application, that should start a TCP server.
I have moved rake command to an entrypoint.sh file and in docker-compose added new service, which is called tcp.
That tcp service return incorrect path, when I run docker-compose…

AutoVit
- 83
- 7
0
votes
0 answers
ENTRYPOINT just refuses to exec or even shell run
This is my 3rd day of tear-your-hair-out since the weekend and I just cannot get ENTRYPOINT to work via gitlab runner 13.3.1, this for something that previously worked with a simple ENTRYPOINT ["/bin/bash"] but that was using local docker desktop…

user1561783
- 483
- 1
- 4
- 14