Skip to main content

Questions tagged [dockerfile]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
840 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 ...
0 votes
0 answers
7 views

bulding docker image for an arm32v7 processor

I managed to build a working docker image on my development laptop, but got an exec format error when I tried to run the docker image on the PC that the container shall run on. My dev PC is an ubuntu ...
2 votes
2 answers
1k 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 ...
0 votes
3 answers
2k 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 ...
0 votes
1 answer
4k 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:...
0 votes
0 answers
65 views

Docker Desktop - WSL distro termined abruptly

I'm on Windows 10 with Docker Desktop and I get this error every time i'm trying to create the image from this dockerfile: # syntax=docker/dockerfile:1 FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20....
1 vote
1 answer
56 views

Can't connect to local mongoDB from Docker Container

I have mongodb running in the host machine (Ubuntu 23.04) in the default port. I have set the bind_ip to be 0.0.0.0. In my docker-compose file, I have added extra_hosts: - "host.docker....
0 votes
2 answers
161 views

How do I run a CI build in a docker image matching the current `Dockerfile` while being resource-aware?

Given a repository containing a Dockerfile that defines the build environment used by the CI pipeline as well as by the developer (e.g. as a Visual Studio Code devcontainer), the CI pipeline shall ...
0 votes
0 answers
32 views

Conda environment in docker

I am new to dockerization and I am trying to make a docker image out of git repository. The Dockerfile looks like this, FROM continuumio/miniconda3:latest ENV PYTHONDONTWRITEBYTECODE=1 ENV ...
0 votes
0 answers
44 views

ADD'ing a zip file during a docker build corrupts the ADD'ed file

I am trying to upload a Python .whl file (essentially a .zip file) while building a Dockerfile image: FROM python:3.12-slim-bookworm RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-...
0 votes
1 answer
94 views

Prevent docker to write inside container

I have an extracted container deployed on a shared storage, and want to launch this container locally. However, when I launch this container to run an application, it creates some temporary files ...
2 votes
1 answer
1k views

Can't change ownership of folders and files in Docker containers

I am having these two dockerfiles which in both I am adding the command RUN chown -R www-data:www-data /var/www/html to change the ownership to www-data user. The containers seems to build ...
0 votes
0 answers
11 views

exporting Mikrotik as an OS

how can I export license "mikrotik" platform as a Docker image file? I boot a OVF file in Virtual machine and I need a command in router OS for build a docker image.
1 vote
2 answers
10k 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: ...
1 vote
3 answers
1k 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 ...
0 votes
0 answers
80 views

Base image can not be fetched within Dockerfile build but can be fetched from shell

Client: Docker Engine - Community Version: 24.0.6 OS: RHEL8 I want to build an existing docker compose project on a new VM. The docker compose project consists of two containers db and web. I have ...
0 votes
0 answers
12 views

Ensuring Ubuntu docker image will not kill the process under heavy load

We run our app as a daemon (or some times with nohup command) so that Ubuntu will not kill this process under heavy processor and memory load. However, we want to dockerize (on Ubuntu 20.04 docker ...
0 votes
0 answers
84 views

Unable to build multi architecture docker image

I want to built a docker image on my Intel laptop. The image will be deployed on both x86/x64 and arm64 hosts. The docker file uses ubuntu:20.04 base image. I tried building the image with following ...
0 votes
0 answers
19 views

node_modules is several orders of magnitude bigger inside the container compare to host machine

I have a simple Next project in Docker following the common recommendations for small-size containers. Heres my Dockerfile: FROM node:16-alpine as dependencies WORKDIR /app COPY package.json ./ COPY ...
0 votes
2 answers
82 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 ...
0 votes
1 answer
2k views

Docker push getting error EOF to private repository

I'm trying to push images to repo private, but it's getting error below. Before, it was working, but idk what happened... PS C:\Users\user\aplication> docker push registry.apprepo.app/app:1.22.3 ...
0 votes
0 answers
26 views

Unable to understand Docker error

I am new to Docker and trying to run a webserver written in Python. I am using Linux Debian running as virtual machine on a Windows host. I have mounted the required folder from my Windows host to the ...
0 votes
1 answer
1k 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-...
0 votes
1 answer
46 views

how to decrease the docker image layers latency during the image build step?

I am following the Microsoft document to create a custom image of vsts-agent on top of ubuntu and install the required capabilities. Since our environment is not having internet enabled, we used ...
35 votes
4 answers
169k views

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

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 ...
33 votes
3 answers
8k 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-...
2 votes
1 answer
664 views

Docker Compose: How do you build an image while running another container?

I'm trying to build a Nuxt 3 application using docker compose. However, I'm having trouble with docker compose and dockerfile configuration. Context To give background on the project that I'm working ...
0 votes
1 answer
1k views

Multistage docker build for Python distroless image

This is my Dockerfile for distroless image similar to this example FROM python:3.9-slim AS build-venv RUN python3 -m venv /venv # other installation steps go here RUN /venv/bin/pip install --upgrade ...
-1 votes
1 answer
221 views

How do I install BlackDuck on mac?

I am trying to scan container images using the blackdock scanning tool. Unfortunately, I couldn't find any free version to play around with; please provide guidance and the simplest way to scan the ...
1 vote
2 answers
332 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 ...
2 votes
3 answers
11k 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 ...
2 votes
0 answers
341 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 ...
0 votes
1 answer
315 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 ...
0 votes
1 answer
1k 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 ...
1 vote
4 answers
5k 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 ...
0 votes
1 answer
2k 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 -...
5 votes
2 answers
13k 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 ...
5 votes
2 answers
388 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 ...
1 vote
1 answer
2k 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-...
3 votes
3 answers
6k 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. ...
5 votes
1 answer
622 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 ...
0 votes
1 answer
90 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 ...
0 votes
1 answer
5k 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) ...
2 votes
2 answers
19k 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 ...
30 votes
4 answers
13k 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 ...
0 votes
1 answer
46 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 ...
1 vote
1 answer
1k 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 ...
0 votes
1 answer
52 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 ...
1 vote
2 answers
374 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 ...
0 votes
2 answers
2k 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-...