Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [dockerfile]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
45 views

Jenkins does not seem to be running inside a container

I am getting an error while running the Jenkins file tp build and push the docker image into docker hub . you can reveiw my code github : https://github.com/iakshaykr/webapp.git (using jenkins_pipe ...
0
votes
1answer
22 views

How to create slave jenkins given master jenkins?

Below code snippet, taken from here creates master jenkins that runs in a container: # Create Docker Group with GID # Set default value of 497 if DOCKER_GID set to blank string by Docker Compose RUN ...
3
votes
1answer
25 views

Adding default external network in docker-compose

I am trying to learn docker and understanding docker-compose As I was trying out the external network section: networks: default: external: name: my-pre-existing-network I understand ...
-1
votes
1answer
17 views

How to find the Linux distro used as the basis for an official docker image?

I already think I understand that docker containers "share" the same Linux kernel running on their host. But inside a particular docker container, the software stack could be a distro debian, alpine, ...
0
votes
1answer
13 views

Deploy dist file in docker file

How to write a docker file to deploy a dist file of an Angular Application In a server. I see most of them have used nginx as a server. Why is it so? Is there any specific reason I want it to be ...
0
votes
2answers
30 views

Docker: PHP deployment in apache, couldn't acces container URL in local browser; shows blank page [closed]

I'm trying to deploy PHP files in Apache container using Dockerfile, Dockerfile on console shows successfully built and tagged but after running the container, i couldn't access the container IP or ...
-2
votes
1answer
12 views

Two JAR FILES execution in dockerfile

How to write a docker file to run two jar files?
0
votes
1answer
52 views

cannot import OpenCV in a Docker container in Raspberry Pi

I am trying to build a Docker container in Raspbian 10. FROM python:3.5-buster RUN apt-get update RUN apt-get install apt-utils -y RUN apt-get install python-opencv -y RUN apt-get install python3-...
2
votes
3answers
72 views

How to automatically update Docker containers in development?

What is the best way to use Docker in development so that a container is automatically updated each time you make a change to the codebase?
0
votes
0answers
11 views

How to get GitLab on the cloud to run command with alias specified in the Dockerfile?

I'm trying to build an image with PMD to use in a runner with a project. I was planning to have PMD run a code analysis before the build and test steps. For that, I tried to set an alias for PMD ...
1
vote
1answer
149 views

npm not found but installed from the shell script file in Dockerfile

I have a following Dockerfile: FROM ubuntu:18.04 RUN mkdir app && cd app WORKDIR app/ RUN apt-get update && apt-get install -y \ software-properties-common \ curl \ sudo ...
1
vote
0answers
28 views

Problem with build jenkins on Dokcer Container with Ubuntu

I Have this Dockerfile and I want build container (based on Ubuntu) and install on him Jenkins. FROM ubuntu:18.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gnupg2 \ vim ...
0
votes
0answers
58 views

Docker COPY symlinks on windows replaces slashes to backslashes

I have an odd behavior that is occurring. When I am building a Dockerfile on my Windows Host that has a COPY command to copy a symlink into the image, the symlink is copied with the slashes replaced ...
0
votes
1answer
28 views

Using the built binary of a docker image in another docker image

Problem I have two repositories A and B. I have a docker image registry, where I can push the docker images made of the repositories A and B. I need only the binary of A's source code to be included ...
3
votes
2answers
107 views

What is the difference between RUN and CMD in a Dockerfile?

I am going to change my permission of files to 600. The following command works perfectly. RUN /bin/bash -c 'chmod 600 /root/.ssh/config' But this one failed CMD /bin/bash -c 'chmod 600 /root/.ssh/...
1
vote
2answers
224 views

jar file is not displaying in docker container

I have an sbt project and i am creating its Jar using the sbt publishLocal command and i want a docker image for that i am doing something like this FROM hseeberger/scala-sbt:11.0.2_2.12.8_1.2.8 ...
0
votes
2answers
153 views

Docker not exposing port on mojave mac

I used brew to install docker, docker-machine and docker-compose. Everything is working, but when I use expose to map port on my host machine, it is not working. When I ssh in docker machine service ...
0
votes
0answers
49 views

Building ASP.NET core app with dockerfile in Jenkins

I have a GitHub Enterprise repository which contains an ASP.NET Core WebAPI sample project with just ValueController. I also have access to Jenkins instance most probably running on Docker somewhere ...
1
vote
1answer
58 views

How to connect to host during a Docker build?

I have a Dockerfile which I want to run some tests inside of as part of a multistage build. The tests attempt to make a connection to localhost, however it appears that they're not able to connect to ...
2
votes
1answer
554 views

running a phpUnit test within a docker container

i want to run a specific version of phpUnit WITHIN a docker container. This container will use a specific version of php. i.e php:5.6-apache Its a lareval application. i have install phpunit via ...
0
votes
1answer
27 views

TravisCI build continues to fail even after changing alpine version

So I ran my Docker build with TravisCI and I got a failure like so: FAIL src/App.test.js ● Test suite failed to run TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' ...
0
votes
2answers
24 views

How do i specify the path of a Dockerfile using Blue Ocean

I want my pipeline created using Blue Ocean (Jenkins) to build with a dockerfile that is not in the root of the git repo. How do I achieve this? Our git repo is a collection of sub-projects with each ...
0
votes
2answers
55 views

Is there an elegant way to use a Dockerfile argument to tag an image?

I use and argument (ARG) in my Dockerfile to download a particular version of an application. I would like to tag my image with that version number. I end up writing something like that: sh$ ...
0
votes
1answer
28 views

Dockerized MySql slower in Wifi than ethernet

When I try to connect to a MySQL server that runs in a docker container(in System A) through my application(Running in system B) via wifi, it takes at least 4X amount of time than it would when both ...
1
vote
1answer
665 views

Dockerfile parse error line 5: unknown instruction: -ESSENTIAL

this is my dockerfile ; FROM ubuntu:16.04 MAINTAINER James Turnbull "james@example.com" ENV REFRESHED_AT 2016-06-01 RUN apt-get update -yqq; apt-get -yqq install ruby ruby-dev build -essential ...
0
votes
1answer
333 views

Troubles with mapping ports on a very simple Docker container

I'm new to Docker and following a tutorial on Udemy.com. The turtorial has me setting and running a very simple container. Docker File # Specify a base image FROM node:alpine # Putting files into a ...
1
vote
2answers
1k views

Jenkins Dockerfile declarative pipelines: getting the built image tag

I'm trying to get the image tag generated with the help of the dockerfile agent in Jenkins declarative pipelines. This Jenkinsfile is incomplete though, because I still need the deployment steps. ...
0
votes
0answers
152 views

How to build docker image from git repository with root context and Dockerfile inside a subdirectory

In the docker documentation one can see that it is possible to build an image from git repository. It is even possible to make a build from the selected branch and directory. I have a repository with ...
2
votes
3answers
268 views

In a Dockerfile, is there a way to avoid copying files to make them accessible to the RUN command?

I need to build a Docker image containing a pre-populate a database. For now, I am using the following commands in our Dockerfile: COPY db-dump.gz /tmp RUN zcat /tmp/db-dump.gz | mysql But is there ...
1
vote
1answer
38 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
3answers
112 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
62 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
19 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 ...
1
vote
1answer
424 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 ...
0
votes
2answers
321 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
38 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
63 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
101 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
63 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
49 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
2answers
397 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
147 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
27 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 ...
23
votes
2answers
8k 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 ...
3
votes
1answer
224 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 ...
1
vote
2answers
61 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
80 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
248 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 ...
-2
votes
1answer
203 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' ...
8
votes
2answers
17k 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 ...