Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [dockerfile]

For questions about Dockerfiles - text files containing instructions to build Docker container images.

-1
votes
0answers
7 views

When tried to run the python script in the dockerfile it gets executed and then gives connection errors [on hold]

while deploying the redis db container and running the python script which dumps all the schemas from running redis-db(source) to the new redis-db(destination) through dockerfile , prompts error . ...
0
votes
0answers
38 views

Dockerfile: How can I input an enter when in interactive .sh installer?

I want to create a Docker image based on Ubuntu image FROM ubuntu:16.04, I have a program to install from a different vendor. It is an .sh interactive installer. It requires the button enter to be ...
1
vote
1answer
23 views

Giving a meaningful name to Dockerfile's VOLUME

In Dockerfile we can use VOLUME /some/folder to let docker always create a volume for the specified folder when calling docker run, without having to explicitly use the -v parameter. The volume ...
0
votes
2answers
32 views

How to get exposed ports from inside of container?

I want to know which port(s) are exposed when user run the image. docker run -p 1000:1234 myimagename I want to get 1234 value in container since I will use it for some configurations(IIS bindings ...
2
votes
1answer
47 views

What is the best way to put on a repository for a docker image with multiple tags?

I've seen a lot of repositories with Docker images and I think (correct me if my guessing is wrong) that the projects that handle a docker image with multiple tags can be grouped into three groups: ...
0
votes
1answer
16 views

Reg uploading additional files in docker hub

Is there any possibilities in keeping additional files in the docker hub account along with docker images. There is description page, but I want to maintain additional files for each image I planning ...
0
votes
1answer
40 views

packge.json not found while executing on Jenkins

My Dockerfile looks something like this. FROM mhart/alpine-node:8.11.3 RUN mkdir -p /app COPY ./ /app WORKDIR /app/build RUN yarn global add serve CMD ["serve", "-l", "3000"] EXPOSE 3000 And ...
1
vote
2answers
22 views

Extra none:none images after docker build

I am quite new on docker and tried to build a postgres database image with preset database scheme created on. Thus created below dockerfile #alpine linux version of the postgres image. uses a really ...
1
vote
1answer
30 views

Using Red Hat Docker image as base image

I am considering using https://access.redhat.com/containers/#/registry.access.redhat.com/rhel7 as a base image for my Dockerfile instead of getting some random image in DockerHub. The main reason is ...
0
votes
3answers
32 views

Availability/Reproducibility of Ubuntu Minimal as Docker image

While for Debian you find on Docker Hub "slim" distributions, it seems not the case with Ubuntu. Now there is a "minimal Ubuntu for public clouds" distro from Canonical, but I can find just cloud VM ...
2
votes
1answer
16 views

How do I prevent service A from being placed in the same node as service B in Docker Swarm?

From the docs, I could only find information about placement restrictions based on node attributes, likes labels and its role. However, I couldn't find how to configure placement based on the services ...
4
votes
1answer
53 views

When exactly and what for should VOLUME in a Dockerfile be used?

When writing a Dockerfile, I do have the option of specifying volumes, such as: VOLUME /var/www But even without this declaration I am able to mount volumes to this directory and other places, e.g. ...
2
votes
1answer
36 views

Built codebase doesnt appear after deploying

I'm packaging and shipping a custom code base of Wordpress with a Dockerfile in to my private container registry. Dockerfile: FROM wordpress:latest ADD . /var/www/html Then on the deployment ...
2
votes
1answer
86 views

Preinstall packages for a nodejs Docker Image according to package.json

I would like to prepare a Docker image for a nodejs project. The developers use package.json to list their node module dependencies. I would like to prepare the Docker image (as base on the Dockerfile)...
1
vote
1answer
29 views

Dockerfile COPY command with three input parameters

I've encountered a Multi-stage Build example, where the first stage builds a ngnix server, and the second stage creates a ngnix service from that image. The second stage looks like this: ... # ...
1
vote
1answer
26 views

what environment does a build “RUN” run in?

When docker build does a RUN command, what "environment" is it running in? Explaining the question, does it run at build time, or when the container starts? Is it using the operating system ...
19
votes
2answers
3k views

Why use EXPOSE in Dockerfile — since you can bind to all ports anyways

I can docker run -p 3000:3000 image without EXPOSEing that port in the container (see below). If that's true, then why bother putting EXPOSE in the Dockerfile? Is it just for communication to image ...
2
votes
1answer
30 views

Docker ADD always invalidates cache

I've got problem with my Dockerfile. After building an image it is pushed to repository as cache-image, so on next builds I can pull it and use with --cache-from. Problem is that build stops using ...
0
votes
0answers
16 views

Docker build not picking up built jar?

I am new to the DevOps world but I am trying to build a pipeline using Jenkins and Docker. I have Jenkins building the docker image by: docker build -f Dockerfile --build-arg jenkins_jar_file=${...
4
votes
1answer
54 views

Docker: strategy-advise for a rookie

I am VERY new to Docker and I looking for a confirmation of my views and my usage of Docker in my use-cases. I'll try it with examples: I have a T3 application. Every tier is a basic requirement (...
2
votes
1answer
53 views

What are the correct volume maps for zabbix running on Docker?

I want to run zabbix inside Docker and there are images for MySQL, Nginx and zabbix server ready to go. I know that to keep the containers stateless I need to map a volume on the host to the ...
-1
votes
1answer
33 views

Docker hostnames are not resolved in a custom network

I have the following configuration in my docker-composer.yml file. version: '3.3' services: service-1: container_name: 'service-1' build: './service-1' depends_on: - 'mongo' ...
2
votes
2answers
3k views

How to change the owner of VOLUME directory in Dockerfile?

I've got the following Dockerfile: FROM ubuntu:xenial RUN useradd -d /home/ubuntu -ms /bin/bash -g root -G sudo -p ubuntu ubuntu WORKDIR /home/ubuntu USER ubuntu VOLUME /opt/myvolume Which I built ...
0
votes
0answers
27 views

Load Balacing Nodejs application using Nginx and Docker

I am following this YouTube tutorial on how to configure Nginx Server on Docker /docker_compose.yml version: '3' services: nodecluster: build: nodecluster ports: - "49160:...
1
vote
1answer
1k views

Change owner of files created inside a Docker container without changing the Dockerfile

When I create a file inside a container with docker-compose run web touch test the file owns to root:root. I want to change it to be $USER without to use chown. I'm aware of the --user option but it ...
2
votes
1answer
87 views

Scanning fs in a Docker container is (much) slower than on host?

Is scanning/searching the filesystem slower in a Docker container, than on the host? Seems a lot slower from my testing and sometimes I get an EIO scan error. Specifically I am scanning a read-only (:...
0
votes
0answers
251 views

Docker: Enable PPP in anapsix/alpine-java Image

I found a docker-image which has an integrated VPN-Client. This image really is smart, because you can run a vpn-connection in a small docker container. This is really helpful if several developers do ...
1
vote
1answer
130 views

Cannot connect to server running on host from Dockerfile / image build

I have a server running on localhost:3440 on the host machine. In a Dockerfile I have: RUN apt-get install -y netcat RUN nc localhost 3440 | tar -x -O > ores-$(date +%s.%N).tgz I've read that ...
0
votes
0answers
114 views

How to see the stdout of Docker slave on Jenkins

I am using the docker as the slave and would like to build in the docker container on Jenkins. The docker is running on my localhost and the connection seems fine. However the build process finish too ...
2
votes
1answer
55 views

Why screen folder in /var/run disappears in Docker container after running Ansible playbook?

Files I've got the following Dockerfile: FROM ansible/ansible:ubuntu1604py3 ENV DEBIAN_FRONTEND noninteractive RUN pip3 install ansible RUN printf '[local]\r\nlocalhost ansible_python_interpreter="...
0
votes
0answers
116 views

How to install an OMS agent in a Windows container?

My Objective: To install OMS agent in Windows container. Why: To View/Monitor the container's logs Azure Log Analytics. What I'm doing now: I followed this ...
1
vote
0answers
322 views

How to deploy with AWS CodePipeline a multicontainer docker environment without dockerfile

I'm using simple docker-compose container images. Here's my docker-compose.yml version: '2' services: db: image: postgres:10.2 ports: - "5432:5432" ...
1
vote
3answers
3k views

How to connect to a docker container?

I have the following Dockerfile: FROM ubuntu:latest MAINTAINER Valter Silva RUN apt-get update RUN apt-get install -y apache2 ADD index.html /var/www/html/ CMD /usr/sbin/apache2ctl -D FOREGROUND ...
2
votes
1answer
70 views

Why can I build this image from Docker for Mac but not on Docker CE for Ubuntu?

Here's my Dockerfile: FROM php:5-fpm RUN apt-get update RUN apt-get install -y php5-mysql RUN apt-get install -y php5-xdebug RUN apt-get install -y php5-mcrypt RUN apt-get install -y php5-gd When I ...
1
vote
1answer
3k views

COPY and ZIP files in Dockerfile

Using a COPY statement creates a new image layer, right? COPY files/foo.zip /tmp/ Now, to save space I could take the ADD statement... for a GZ arhive. But ADD does not support automatic extraction ...
1
vote
2answers
449 views

docker container for running automation scripts using jenkins

For my test environment, I am trying to setup the following setup. Create scripts in Frisby Have a jenkins job, which creates a slave which is a docker container. The docker container will ...
4
votes
2answers
63 views

Docker vs CMS - related or a different thing?

I am new to DevOps and I am trying to catch the techniques and their names and meanings. I looked wikipedia explanations on Puppet (a Configuration Management System example) and that of Docker. ...
4
votes
2answers
111 views

How to automate the magento2 installation process too via docker

This is what I have accomplished up to now. Written a docker file where I have done the following and for now I have not used the docker compose. Used alpine as base Os setup nginx setup php-fpm ...
5
votes
1answer
468 views

Docker Images via Container vs Dockerfile

Pardon the dumb questions, but I've been learning about Docker and container technologies and I was learning about using Dockerfiles to specify build instructions for an image, and how each ...
14
votes
3answers
5k views

What are the advantages of dockerizing nginx and php in different containers?

I just started working with Docker and Kubernetes and I've been watching a lot of stacks, in which some people build nginx+php in a single image and some build an image with nginx and another one with ...
1
vote
1answer
407 views

How to start a service in fedora container without using systemd?

I want to start a service in my fedora docker container. But since systemd is not working in the fedora container. I am unable to start the service. I'm getting following error. Failed to connect ...
24
votes
3answers
5k views

Understanding Docker layers

We have the following block in our Dockerfile: RUN yum -y update RUN yum -y install epel-release RUN yum -y groupinstall "Development Tools" RUN yum -y install python-pip git mysql-devel libxml2-...
5
votes
2answers
298 views

Make use of CIs as Maven Repository in order to use it for building Docker images without including dependencies

I am trying to make images from our company Maven based applications. These apps are using some libraries which are included in a Maven repository, but fills a lot of disk space. They also have some ...
0
votes
1answer
730 views

How to make custom SLES (SuSe Linux Enterprise) Dockerfiles?

To use a dockerized SLES, you need to use an official base image and run it on a SLES host. But this does not seem to work out of the box - what needs to be done to build a custom image? Dockerfile:...
8
votes
1answer
58 views

What is the difference between using brackets (`[` `]`) and just specifying the command in the CMD option in Dockerfiles?

Why does CMD ["mysqld"] result in: db_1 | 2017-05-14T16:34:11.829163Z 0 [Note] mysqld (mysqld 5.7.18) starting as process 1 ... db_1 | 2017-05-14T16:34:11.833159Z 0 [Note] InnoDB: PUNCH HOLE ...
13
votes
4answers
29k views

How to remove directories and files in another layer using Docker?

Why this question? The reason for posting this Q&A is that sometimes certain software is required to compile software in a docker image. Once compiled, these packages are superfluous and should ...
3
votes
2answers
62 views

Why can this ENV not be found when it is defined in one layer using a Dockerfile?

When the following Dockerfile: ENV A=123 \ B=$A RUN echo $B is run, it results in: Step 2/2 : RUN echo $B ---> Running in x ---> y Removing intermediate container z When two ENV ...