Questions tagged dockerfile

Explore the latest questions and answers asked by our top developers.

dockerfile user and uid change alltime possible?

Hi i have an understanding question about users in dockerfile. for example i want to change the user and uid in this image: https://hub.docker.com/_/postgres is this possible or depends on the structure of commands (line 4)? (https://hub.docker.com/layers/postgres/library/postgres/latest/images/sha256-7f4833e68f89d2c786b7034f70f3afab239308e3bcf8e409b74905084e6785e4?context=explore) in the confluence repo (https://hub.docker.com/r/atlassian/confluence) i can change the ENV vars to solve it Source: Dockerfile Questions

By Ted Mosby
Published
Categorised as dockerfile Tagged

How to send container to detach mode which require tty at the beginning of the process?

my Dockerfile contain excutable script and their corresponding flag as CMD instruction. If i start docker container using docker run -d then my excutable script get terminated. If i start docker container using docker run -it then container will keep running. Now if i want to quit terminal i can do ctr and pq it […]

By Akshay Gopani
Published
Categorised as docker, dockerfile, tty Tagged , ,

Docker compose passing parameters to set as environment variables of Dockerfile

The following is my Dockerfile FROM openjdk:11.0.7-jre-slim ARG HTTP_PORT NODE_NAME DEBUG_PORT JMX_PORT ENV APP_ROOT=/root HTTP_PORT=$HTTP_PORT NODE_NAME=$NODE_NAME DEBUG_PORT=$DEBUG_PORT JMX_PORT=$JMX_PORT ADD spring-boot-app.jar $APP_ROOT/spring-boot-app.jar ADD Config $APP_ROOT/Config ADD start.sh $APP_ROOT/start.sh WORKDIR ${APP_ROOT} CMD ["/root/start.sh"] Contents of start.sh as follows: #!/bin/bash java -Dnode.name=$NODE_NAME -Dapp.port=$HTTP_PORT -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar spring-boot-app.jar I am able to run using same image […]

By Mahendran
Published
Categorised as docker, docker-compose, dockerfile Tagged , ,

Why do I get Syntax error "}" unexpected in building Dockerfile?

When I try to build Dockerfile with this line of code: RUN modifyPermissions() {if [ -n "${OWNER}" ]; then chown "${OWNER}":zagrebgroup -R /var/log/app /mnt; else chown 1001:zagrebgroup -R /var/log/app /mnt; fi } I have this error: /bin/sh: 1: Syntax error: "}" unexpected Looks like the problem is in last curly bracket but I can’t understand […]

By jtodi
Published
Categorised as docker, dockerfile, sh Tagged , ,

I deleted the log file in the docker container, now the new logs are now getting created. How to get the file with new logs?

I used rm-rf to delete the file, how can I get the file with new logs? Source: Docker Questions

By Sanjana Kapoor
Published
Categorised as containers, docker, dockerfile, logging Tagged , , ,

Dockerfile use ARG or ENV in CMD exec form (Or pass SIGTERM signals with shell form)

FROM python COPY ./src ./src COPY ./${APP} ./${APP} ARG APP=undefined ENV APP ${APP} CMD python -m ${APP} With the same code I need launch 2 applications start_1 and start_2. This is defined IN the APP ARG. so to build & launch an specific app I would use sudo docker build –build-arg APP=start_1 & sudo docker […]

dockerfile COPY not copying file

I’m creating a dockerFile and trying to copy an environment configuration file that I’ve at the same path where dockerFile is found. The idea is to copy it during the docker build process to be able to use it during the gradle build a few steps later. RUN set -ex && cd /app/src && git […]

By KKrusti
Published
Categorised as docker, dockerfile Tagged ,

Docker usages both in dev and prod

I am a newbie to docker and get confused about some concepts in my way studying it. I try to arrange my questions from bottom up so that it is easy to read and identify any misunderstanding about the basic concepts. Any help is highly appreciated. 1. Browsing docker repositories It looks like to me […]

How to config an API Gateway with Docker-Compose?

I’m developing an application for a university project. It is made up of 2 microservices: user and purchase. This is (a part of) my docker-compose.yaml file configuration: user-service: <<: *common-settings container_name: user-service build: ./user-service ports: – 8081:8080 purchase-service: <<: *common-settings container_name: purchase-service build: ./purchase-service ports: – 8082:8080 So, If for example I want to test […]

How can I make packages installed using Poetry accessible in Docker?

I have a Django REST framework API that I’m trying to run in Docker. The project uses Poetry 1.1.12. When running, I can see that Poetry is installed correctly, and that Poetry installs the packages in my pyproject.toml, including Django. I’m using supervisor to run the API using Daphne, as well as some other tasks […]

1 2 3 4 5 609

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq