I am trying using Docker using Dockerfile.
My Dockerfile as follows, where I am using debian linux system.
FROM debian:jessie ENV DEBIAN_FRONTEND noninteractive ARG AIRFLOW_VERSION=1.7.1.3 ENV AIRFLOW_HOME /usr/local/airflow .. .. COPY script/entrypoint.sh /entrypoint.sh COPY config/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg .. .. USER airflow WORKDIR ${AIRFLOW_HOME} ENTRYPOINT ["/entrypoint.sh"]
So when I run docker build -t test .
, it build without problem.
However, when I run docker run -p 8080:8080 test
.
It throws following error:
container_linux.go:247: starting container process caused "exec: \"/entrypoint.sh\": permission denied" docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"/entrypoint.sh\": permission denied".
What is I am doing wrong ?
Fix 1: Run all the docker commands with sudo If you have sudo access on your system, you may run each docker command with sudo and you won't see this 'Got permission denied while trying to connect to the Docker daemon socket' anymore.
The error message tells you that your current user can't access the docker engine, because you're lacking permissions to access the unix socket to communicate with the engine. As a temporary solution, you can use sudo to run the failed command as root (e.g. sudo docker ps ).
Limit a container's access to memory The maximum amount of memory the container can use. If you set this option, the minimum allowed value is 6m (6 megabytes). That is, you must set the value to at least 6 megabytes. The amount of memory this container is allowed to swap to disk.
You need to change the permission of the bash file by chmod +x entrypoint.sh
before calling ENTRYPOINT. So change your code to the following:
USER airflow WORKDIR ${AIRFLOW_HOME} RUN chmod +x entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
Rebuild the image and run the container, it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With