Questions tagged [dockerfile]

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

Filter by
Sorted by
Tagged with
-1 votes
0 answers
11 views

What command CMD["tini", "--", "node", "./bin/www"] means?

I am trying to understand what the following command does: CMD["tini", "--", "node", "./bin/www"] I am not sure what is going on in this command please?
user avatar
  • 99
0 votes
0 answers
7 views

Docker images vs CRI images compatibility in light of dockershim removal from Kubernetes

So at 1.24 Kubernetes removes the dockershim. I was studying docs and if I understand them correctly Kubernetes supports only images in Open Container Initiative format? And Docker image is not the ...
user avatar
  • 63
0 votes
0 answers
14 views

Minimize `docker build` execution time inside Docker-in-Docker containers

The use case: We have several "Release jobs" in Jenkins that build and push a Docker image of the application to a docker registry, update the project version in various files and finally ...
user avatar
  • 13
0 votes
0 answers
254 views

Docker warning about platform not matching the host platform

I have a Dockerfile that works on both mac and windows. But when I create an actual container on mac, I always get a warning that says: PS /Users/me/> docker run -it platformtest /bin/bash WARNING:...
user avatar
  • 115
2 votes
0 answers
24 views

Run commands on docker container and sync automatically with host

I Dockerkized a MENN(Nextjs) stack App, now everything works fine. I run into issues when i need to install npm packages. let me first show you the structure src/server/Dockerfile FROM node:14-alpine ...
user avatar
1 vote
0 answers
23 views

Access AWS Secret inside docker file

I have a docker file running on AWS that looks like the following: FROM ubuntu:latest RUN apt-get update RUN apt-get install -y python3 RUN apt-get install -y git RUN git init RUN git clone https://&...
user avatar
  • 11
0 votes
1 answer
63 views

Buildkit failing arm builds with missing binaries even though they are in $PATH

A few of our developers recently got some M1 machines, I want to provide them with ARM compatible images and have set my sights on Buildkit. I set up a podTemplate in Jenkins and run the build with ...
user avatar
1 vote
3 answers
63 views

How do I create a Docker image from a container without configuration changes?

I am aware of two ways of creating Docker images: Build the image using a Dockerfile Use docker commit <container_id> against a running container with changes. I find changing a Dockerfile ...
user avatar
  • 111
0 votes
0 answers
11 views

How to change container's port to another one without reconfiguring the service inside of it and without mapping it to a port on the host machine?

I'm running a local DNS that automatically creates entries for docker images from their name. I want to be able to type "jira.test" in my browser address bar and have the web interface be ...
user avatar
0 votes
1 answer
92 views

Install a RPM from build context without copying it first

During dockerbuild, I'd like to install a (rather big) RPM from build context/host without copying it first into the image in order to keep my image small. Ideally, there would be a way to read a file ...
user avatar
0 votes
0 answers
13 views

Windows Based Docker Images

I am in the middle of testing this: https://github.com/docker-archive/communitytools-image2docker-win, converting a VHD to a Docker Image. But based on what I am reading, it will only install ...
user avatar
0 votes
0 answers
24 views

Docker image does not launch node web app

Trying to follow this tutorial from MS but I keep getting "This page isn't working" error. Is there something wrong with the index.js file that is causing the page to not come up? Here is ...
user avatar
0 votes
0 answers
195 views

Docker image build Error : unable to find user admin: no matching entries in passwd file

here's how my Dockerfile look like : [root@centos7 ~]# cat Dockerfile # syntax=docker/dockerfile:1 #use centos image FROM centos # Add none root user CMD useradd admin && echo "admin:...
user avatar
0 votes
1 answer
120 views

My Python application doesn't communicate with MySQL inside docker. Can someone help me?

The connection is not succeeding in docker. Look at my settings: Dockerfile FROM python:3.8.5-alpine WORKDIR /app COPY requirements.txt . RUN python3 -m pip install --upgrade pip RUN pip install -...
user avatar
0 votes
2 answers
36 views

Specify image in Dockerfile based on building client platform/architecture

I have a somewhat specific, Swift-based problem. It seems that none of the official Swift images on Dockerhub support the M1, and instead the only seemingly reliable arm64 Swift images are found at ...
user avatar
  • 1
1 vote
2 answers
2k views

DNS resolution fails when container is started via docker-compose

I recently decided to try out windows containers and i am using my private minecraft server for that purpose (as a hobby project). I have an image prepared, based on Windows Server Core 2022. When i ...
user avatar
0 votes
0 answers
19 views

How to load several environment variables without giving env and args only giving settings.env file in the Dockerfile?

NOTE: Here we don't use docker run command and docker-compose.yml only using dockerfile and settings.env how can we can achieve this requirement.
user avatar
1 vote
1 answer
316 views

Building a docker container with multiple conda envs

As a novice to the technology I have only a basic knowledge regarding how to build and deploy a docker so i was hoping someone could provide some help. The situation is the following: I need to create ...
user avatar
  • 11
1 vote
1 answer
133 views

Package installed using Dockerfile not available on Jenkins pipeline stage

I'm having sort of a weird problem with my Jenkins pipeline. I've defined a Dockerfile which installs some tools I need for my CI/CD pipeline, such as node, npm, sfdx, and sfpowerkit (a plugin for ...
user avatar
0 votes
1 answer
188 views

PROXY is not working inside windows container

I'm using windows containers in windows 10. I've set proxy variables(HTTP_PROXY,HTTPS_PROXY) in environmental variable setup and using VPN. I also configured resources -> Proxies. I was trying to ...
user avatar
1 vote
0 answers
127 views

Redhat Nodejs-minimal yarn not found

Coming across a very odd issue here: Whenever I try using a ubi8/nodejs-14-minimal base image, the build fails with /bin/sh: yarn not found. I have installed yarn already by adding a Run npm install ...
user avatar
5 votes
2 answers
140 views

Best Practice for writing DockerFile

I have mostly seen people using following type of pipeline steps(it varies, but in general this is the flow of steps I have observed) Process: clone repo -> build -> test -> create docker ...
user avatar
  • 151
1 vote
1 answer
466 views

Using access tokens on Dockerfile to clone repository: RUN command error

In a Dockerfile, I'm trying to clone several Gitlab repositories that are specified in a file, one per line, using an access token passed as an environment variable set in docker-compose.yml: COPY my-...
user avatar
  • 121
0 votes
1 answer
60 views

Continuous Deployment with jenkins

I am a beginner in DevOps. I created a continuous integration cycle using jenkins(docker image) and bitbucket. I used a simple spring boot hello-world project and after CI i got an executable Jar. I ...
user avatar
0 votes
1 answer
2k views

Having trouble with building Docker image

I'm trying to build a docker image for a software using docker build -t cytools . Here is the output that I'm confused about: [+] Building 0.0s (1/2) ...
user avatar
1 vote
2 answers
2k views

How can I get the Docker target platform inside the Build Environment / Dockerfile

I'm doing multi-platform builds with buildx and would like to know if there is a way to determine what platform is currently being build so I can avoid certain steps for certain environments. For ...
user avatar
  • 113
0 votes
1 answer
34 views

is a secrets-provider-container a good idea?

I am looking for a way to provide secrets to a container running on Google Cloud Run responding to the following criteria: secure centralized & pulled based free simple working with a team, with ...
user avatar
1 vote
2 answers
195 views

Can I build docker image containing ARM executable when running docker build on non-ARM architecture?

I have built on an x86-based Windows laptop a Docker image to be run as a container on an ARM-based architecture (Raspberry Pi 4). Due to ending up with an x86 executable when this is built in the ...
user avatar
1 vote
0 answers
56 views

How to correctly copy a file when building an image on Docker Hub?

I have a fairly simple Dockerfile, which works locally. However, when I build it on Docker Hub I get the following error: Starting build of index.docker.io/adius/tasklite:next... Step 1/16 : from ...
user avatar
  • 111
2 votes
2 answers
5k views

How to serve a custom index.html using the stock nginx docker image?

How do I serve static content from the default nginx docker image? Given: root@mordor:~# root@mordor:~# docker image ls nginx REPOSITORY TAG IMAGE ID CREATED ...
user avatar
0 votes
1 answer
128 views

How to navigate to an index.html with nginx?

This builds and runs without apparent error: root@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# docker exec -ti some-nginx bash root@2c912aa5ce5c:/# root@2c912aa5ce5c:/...
user avatar
0 votes
2 answers
444 views

How to copy HTML files to include into nginx?

How do I copy an index.html file into nginx? root@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# ll total 12 drwxrwxr-x 2 nicholas nicholas 4096 Nov 13 16:18 ./ drwxrwxr-...
user avatar
0 votes
2 answers
389 views

Minecraft docker-container refuses connection

So I have this Dockerfile: FROM openjdk:8u212-jre-alpine LABEL maintainer "cowboy_patrick" RUN apk add --no-cache -U \ openssl \ imagemagick \ lsof \ su-exec \ shadow \ bash \ ...
user avatar
2 votes
1 answer
35 views

why use multiple From instructions in multistage build?

I'm new to Docker, sorry if my question sounds dumb. below is a dockerfile from a textbook shows how multistage build works: FROM diamol/base AS build-stage RUN echo 'Building...' &...
user avatar
  • 123
2 votes
2 answers
96 views

Unable to build Image as it is asking some input

I am trying to create an Image which will run ftp server on centos. Dockerfile content is as below: FROM centos RUN \ yum update -y && \ yum install vsftpd -y EXPOSE 21 CMD vsftpd -...
user avatar
1 vote
1 answer
253 views

Grant access permission to file when mounting from host

Below is except of my docker-compose.yml file I am trying to mount from host file inside the container, which works i.e. able to mount but then I need to give it permission (my clumsy chown command, ...
user avatar
  • 11
4 votes
1 answer
18k views

Permission denied within mounted volume inside Docker/Podman container

I am starting to learn about containers using podman that came with RHEL8.1 (which AFAIK can be used in place of docker), and have the following baby Dockerfile as a learning exercise: # Use Alpine ...
user avatar
  • 221
1 vote
1 answer
94 views

Why does running echo with exec form in a Dockerfile create /etc/resolv.conf?

I was trying to build a Docker image from a Dockerfile and I had a line in there which reads: RUN ["echo", "'anything'", ">", "./a_file"] This didn't work, and I eventually had to use: RUN ["sh",...
user avatar
  • 141
1 vote
1 answer
34 views

Running Two infinite commands on single pod/image

I have a Dockerfile with a CMD, it calls a .sh file that runs a Django app ( makemigrations, migrate and uwsgi ) And that runs fine in a pod. There's a django admin script that runs infinitely that I'...
user avatar
  • 31
2 votes
1 answer
173 views

Multiple apps (microservices) and one proxy (nginx) docker-compose configuration/architecture

Having the following architecture: Microservice 1 + DB (microservice1/docker-compose.yml) Microservice 2 + DB (microservice2/docker-compose.yml) Proxy (proxy/docker-compose.yml) Which of the ...
user avatar
  • 153
4 votes
1 answer
224 views

Should I chunk my docker images in many small layers instead of one large?

When I build docker image for existing applications I try to use as few layers as possible and clean up any unwanted files. For example building an image for moodle: # Dockerfile for moodle instance. ...
user avatar
0 votes
1 answer
50 views

Does Docker images works without client application

I recently installed Docker in Ubuntu 18.04 and with that, I have downloaded the mariadb image like this docker run --name mariadb \ -p 3306:3306 \ -v /opt/mariadb_data:/var/lib/mysql \ -e ...
user avatar
  • 115
1 vote
1 answer
70 views

Do I need header files once I install the php extention on Dockerfile?

Usually when I build docker images for php I use this approach: FROM php:7.2-apache RUN apt-get update && \ apt-get install -y libghc-postgresql-simple-dev &&\ docker-php-...
user avatar
1 vote
1 answer
986 views

create entry-point script to get all env variables starting with VUE_APP_ and take it's value

I would like to Dockerize my existing vuejs app for staging , production and I used multi staged approach to create my app container and I'm using Ubuntu 18.04 and this is my, Dockerfile # build stage ...
user avatar
  • 115
1 vote
2 answers
7k views

docker | database connection refused between two containers

I have a mysql database running with the following docker-compose.yml: version: '3.3' services: db: image: mysql:5.7 restart: always environment: ...
user avatar
  • 111
4 votes
1 answer
475 views

How to pin OS package versions in Docker image

Scenario For obvious reasons I believe that every package installed in a Docker image should have their version nailed down. That's why in our Dockerfile we always enforce the OS package manager to ...
user avatar
1 vote
1 answer
58 views

How to develop a docker container for laravel without laradock or docker-compose

I am very new to docker. I want to build a laravel development environment with docker. I already tried laradock but it seemed complicated for me. I was wondering whether it is possible to create a ...
user avatar
0 votes
1 answer
55 views

Using 32 bit for savings

What are the downsides for CI servers to use 32 bit Docker images? For example, using FROM i386/python:3.6.9-alpine3.9 instead of python:3.6.9-alpine3.9 in Dockerfile. python:3.6.9-alpine3.9 (32 bit,...
user avatar
0 votes
2 answers
34 views

Configure Kubernetes with docker container on Ubuntu VM

I am using the YAML file to deploy the container on Kubernetes with some replication factor on a hosted machine. YAML File apiVersion: apps/v1 kind: Deployment metadata: name: mojo-deployment ...
user avatar
  • 101
2 votes
1 answer
3k 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 ...
user avatar