Questions tagged [docker-build]

The Docker CLI (Command Language Interpreter) command for building Docker images.

Official documentation for this command is available here:

https://docs.docker.com/engine/reference/commandline/build/

560 questions
15
votes
2 answers

Invalid argument for "-t --tag" flag: invalid reference format

I'm trying to build the docker image using this script: release.sh #!/bin/sh set -e export ENV="prod" export REGISTRY_HOST="registry.seesunit.kr" export IMAGE_PREFIX="$ENV-scim" export IMAGE_TARGET="web" export…
frankiie
  • 456
  • 1
  • 6
  • 19
15
votes
1 answer

Installing msi on a docker container

Need help with dockerizing legacy application I have a legacy app which contains multiple components(msi installers). These components use variety of technologies like C#, windows forms, C++, MFC, .net remoting, C# webservices(asmx). Out of these…
Satish
  • 445
  • 2
  • 4
  • 15
15
votes
1 answer

Is it possible to set a MAC address for `docker build`?

With docker run, it’s possible to fix the MAC address with the --mac-address option. I’ve looked, and I can’t find a way to fix the MAC address with docker build. I am wanting to dockerize software that has a license fixed to a MAC address (I’m not…
Bill Denney
  • 766
  • 1
  • 6
  • 21
14
votes
3 answers

OSX Docker Build: How can I see the full build output? (--progress=plain not the solution!)

I just got a MacBook from work and I am using it to build docker images. Usually, the docker build shows the full log (i.e. ls -la showing the cwd). Thats at least what I'm used to from my linux machine. On the macbook however, it only shows a brief…
Codebaard
  • 409
  • 4
  • 12
14
votes
2 answers

Is it possible to docker build a multi-staged image in parallel?

I have a rather large Dockerfile that has multiple layers. Some of these layers need quite some time. I noticed that many things do not depend on each other. So hence the obvious question: Can I docker build in parallel? The docker build only seems…
User12547645
  • 6,955
  • 3
  • 38
  • 69
14
votes
2 answers

Docker build error OCI runtime create failed "exec: \"/bin/bash\": stat /bin/bash

Getting following error while run docker build... OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
Thế Huynh Phạm
  • 551
  • 1
  • 4
  • 12
14
votes
1 answer

Running a background process in container during one step in docker build

I'd like to run integration tests of an app during docker build. These tests require a Redis server being available. How can I run redis-server and keep it running in the background during the integration-test step, i.e. gradle build? Here is the…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
13
votes
5 answers

How to set breakpoint in Dockerfile itself?

Searching up the above shows many results about how to set breakpoints for apps running in docker containers, yet I'm interested in setting a breakpoint in the Dockerfile itself, such that the docker build is paused at the breakpoint. For an example…
Mario Ishac
  • 5,060
  • 3
  • 21
  • 52
13
votes
3 answers

Pass ARG to ENTRYPOINT

Say I have this in a Dockerfile: ARG FOO=1 ENTRYPOINT ["docker.r2g", "run"] where I build the above with: docker build -t "$tag" --build-arg FOO="$(date +%s)" . is there a way to do something like: ENTRYPOINT ["docker.r2g", "run", ARG FOO] //…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
13
votes
3 answers

How to copy/add files in user's home directory in host to container's home directory?

# Update I just realized that ADD/COPY command doesn't permit any access to files or directories outside of current working directory in host. One more thing is that if you specify an absolute path of file/directory as a source path after ADD/COPY…
Sung-Jin Park
  • 149
  • 1
  • 1
  • 4
12
votes
1 answer

How to fix error "npm ERR! could not detect node name from path or package" when building simple app with docker and nodeJS?

Dockerfile FROM node:alpine COPY ./ ./ RUN npm install CMD ["npm", "start"] index.js const express = require('express'); const app = express(); app.get('/', (req, res) => { res.send('Hi there'); }); app.listen(8080, () => { …
user14695458
12
votes
1 answer

Docker build sometimes fail on "file not found or excluded by .dockerignore" for a nested ignored file

My directory structure: ├── src/ ├───── backend/ ├─────── Dockerfile ├─────── ... ├───── frontend/ ├─────── Dockerfile ├─────── node_modules/ ├─────── ... ├───── commons/ ├─────── ... ├── .dockerignore .dockerignore includes the line…
Mugen
  • 8,301
  • 10
  • 62
  • 140
11
votes
3 answers

Dockerfile COPY from image to host

I have a Dockerfile in which I first compile the Mosquitto server in one layer, then use COPY to copy the source files of an authentication plug-in into the image and finally RUN the compilation of that plug-in. All in all, the resulting image is…
Daniel F
  • 13,684
  • 11
  • 87
  • 116
10
votes
1 answer

docker buildx fails to show result in image list

The following commands do not show the output ubuntu1 image: docker buildx build -f 1.dockerfile -t ubuntu1 . docker image ls | grep ubuntu1 # no output 1.dockerfile: FROM ubuntu:latest RUN echo "my ubuntu" Plus, I cannot use the image in FROM…
Sagi Mann
  • 2,967
  • 6
  • 39
  • 72
10
votes
1 answer

Building Docker image as non root user

New here, was wondering if someone had experience with building images as non root user? I am building Kotlin project, (2 step build) and my goal is now to build it as non root user. Here is what my Dockerfile looks like. Any help would be…
vukojevicf
  • 609
  • 1
  • 4
  • 22
1 2
3
37 38