Questions tagged dockerfile

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

Copying node_modules into a dockerfile vs installing them

I’ve been tasked with dockerizing our Node app at work. When it comes to node_modules, I’m in a bit of a disagreement with our lead dev. He is advocating for something like this in the dockerfile. His reasoning is that the docker image will be more deterministic, and on that point I don’t entirely disagree […]

linux terminal error an image does not exist locally with the tag

im doing an assigment for uni thats due in couple of hrs and I hope someone can help me. basically im almost done and i have to push my dockerfile image to dockerhub (im using ubuntu on virtual box btw) but i keep getting the error An image does not exist locally with the tag. […]

By poetryisblue
Published
Categorised as docker, dockerfile, terminal, ubuntu Tagged , , ,

Docker CMD cant not read argument in node application

Here is my build command docker build –build-arg APP_PROJ=proj1 –build-arg APP_ENV=dev -t proj1 . Giving two argument,APP_ENV and APP_PROJ.And here is my Dockerfile content FROM node:14.15 AS build ARG APP_ENV ARG APP_PROJ WORKDIR /usr/src/app COPY package.json package-lock.json ./ RUN npm cache clean –force RUN npm i COPY . . RUN npm run build:${APP_PROJ}:${APP_ENV} CMD [ […]

By AlanZh
Published
Categorised as angular, docker, dockerfile Tagged , ,

unable to run npm install in docker image (getting auth error)?

I have a very simple Dockerfile FROM node:17.3.1 as build WORKDIR /app COPY package*.json . RUN npm install COPY . . RUN npm run build FROM node:17.3.1 WORKDIR /app COPY package.json . RUN npm install –only=production COPY –from=build /app/dist ./dist CMD npm run start:prod When running docker build -t nestjs-hello-world . I am getting the […]

By Nik
Published
Categorised as docker, dockerfile, node.js, npm, npm-install Tagged , , , ,

How to substitute environment variables in Nuget.config when creating a Docker container via Azure Devops YAML Pipelines?

I am creating a .NET Core 6 web app inside a docker container via Azure Devops YAML pipelines. However I am having problems with nuget not restoring packages from a private commercial external nuget feed (for Telerik). "HTTP401 failed authentication" response. So how do I pass in in the values for the %TELERIKUSERNAME% and %TELERIKPASSWORD% […]

By Kyle
Published
Categorised as .net-core, azure-pipelines, dockerfile, nuget Tagged , , ,

Error running prometheus_exporter gem in docker container

I’m trying to start the prometheus_exporter gem with -b 0.0.0.0 parameter, in a docker container. I get this error: remote: /usr/local/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo’: getaddrinfo: Name or service not known (SocketError) remote: from /usr/local/lib/ruby/2.6.0/socket.rb:227:in `foreach’ remote: from /usr/local/lib/ruby/2.6.0/socket.rb:762:in `tcp_server_sockets’ remote: from /usr/local/lib/ruby/2.6.0/webrick/utils.rb:65:in `create_listeners’ remote: from /usr/local/lib/ruby/2.6.0/webrick/server.rb:127:in `listen’ remote: from /usr/local/lib/ruby/2.6.0/webrick/server.rb:108:in `initialize’ remote: from /usr/local/lib/ruby/2.6.0/webrick/httpserver.rb:47:in `initialize’ remote: from […]

By wsa
Published
Categorised as docker, dockerfile, prometheus, ruby Tagged , , ,

Add .env.example in dist folder during docker compose up

I want to generate an .env and and an .env.example file and push it to the docker image during the docker build with Dockerfile. The problem is that the .env.example file is not copied to the docker image. I think it works with the normal env, because I copy the env.production and save it as […]

Editing files in a read-only directory in docker container

I would like to add some Core dump configuration to an Opensips docker container. At present, I am only generating a coredump file with the name "core" (which could be overwritten). The changes I need to make are: echo 1 > /proc/sys/kernel/core_uses_pid –> which generates "core.6645" for example and echo ‘core.t.sigp’ > /proc/sys/kernel/core_pattern –> This […]

By Jim Lahey
Published
Categorised as dockerfile, readonly Tagged ,

Docker run not working with: failed to load … permission denied

I’m trying to deploy on Digital Ocean (which is a Datacenter), I’m having a problem which prevent the deployment. The build process works good. My project Dockerfile: #################################################################################################### ## Builder #################################################################################################### FROM rust:latest AS builder RUN rustup target add x86_64-unknown-linux-musl RUN apt update && apt install -y musl-tools musl-dev RUN update-ca-certificates WORKDIR /myrustapp COPY ./ […]

C++ and .Net core not building in single Dockerfile

I have following dockerfile. It is compiling c++ as well as .net projects. When I add .net code C++ layers are not working. If I remove .Net Layers then C++ Layers are working. Is this something can’t be done in single file? # GCC support can be specified at major, minor, or micro version # […]

By Anonymous Creator
Published
Categorised as docker, dockerfile Tagged ,
1 2 3 604

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