docker in mac: ./start.sh: no such file or directory" - macos

I am trying to run docker on my macbook with sierra... It is okay to build and run on my openshift but I have a problem on local. I think the problem is in this line:
COPY . /tmp/app
and the docker cant copy files (including start.sh) to path. can you help me please?

Related

Laravel on windows with Docker and Linux subsystem issue

When running with Docker on Windows and using linux subsystem (WSL version 2) I can't get Docker to delete any container that I want to remove. Anyone else had this problem on windows and how to solve it?
See screenshot to how Docker responds:
Docker says "can't remove docker container, reason being that folder in question '/home/niko/laravel-app1', it's path can not be found.
however I can navigate to this folder via Explorer \wsl$\Ubuntu-20.04\home\niko\laravel-app1
Anyone had any experience with this and how to get Docker to understand where the files actually are so it can delete the container when I ask it to do so?

mvnw file throwing error in windows while building docker image

I have a spring-boot project which was created on mac and pushed to github, I am cloning it on my windows 10 laptop, and trying to build docker image by referring to Multi-Stage Build https://spring.io/guides/topicals/spring-boot-docker/
here while running the Dockerfile I am getting following error:
---> Running in 4ae632bc1c4b
/bin/sh: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
I know that dos2unix.exe mvnw will fix the issue, but just wanted to know why this is happening, I am not editing the mvnw file on my windows and still it is having some windows line endings.
I fixed it by changing the encoding of the /mvnw file to UTF8 - LF. After this I was able to generate the image without problem.

failed to compute cache key: failed to create hash for <DIR>: operation not supported

while attempting to build an image in Docker/macOS, I get the following error:
failed to compute cache key: failed to create hash for
/app-temp/client/dist: operation not supported
My Dockerfile looks like this:
FROM node:lts-alpine as ui-build
WORKDIR /app-temp
COPY client/ ./client/
RUN cd client && npm install
RUN cd client && npm run build
FROM node:lts-alpine as api-build
WORKDIR /app
COPY --from=ui-build /app-temp/client/dist ./client/dist
COPY server/ ./server/
RUN cd server && npm install
EXPOSE 3000
CMD ["node", "/app/server/src/index.js"]
And the docker command that I am using is:
docker build -t test-image .
Now, note that the image is successfully built in a Linux machine. However, the above-mentioned error persists in a macOS machine.
I am running macOS Big Sur 11.2.1.
Any ideas as to how solve this problem?
Thanks in advance.
just in case someone else finds himself here
Look in your .dockerignore file if dist is in the list
Also, try building with BUILDKIT disabled
DOCKER_BUILDKIT=0 docker build ....
Im gonna throw my solution out there.
Setup: .net 5 web app with docker enabled, contains a dockerfile that was created by visual studio.
There was a step where the docker file was saying to copy my csproj up to the parent folder. I edited the source directory to from parent/myproject.csproj to myproject.csproj then I ran docker build and it worked.
Im assuming that when I run docker build I was down one level in the child folder where the dockerfile lives, and the paths just werent lining up.

Why is my docker build command failing

I have docker installed on my macbook pro OS Sierra 16G1212
I have a simple docker file in /mypath/Dockerfile
When I try the command:
docker build .
I get an error:
error checking context: 'can't stat '/Users/bdisha/Library/Caches/com.cisco.Jabber/com.apple.opencl''.
What am I doing wrong?
Thank you
The problem was resolved by me creating a "dockerfiles" directory and moving my Dockerfile in there.
After that, I could manage to build the image just fine.

Docker unable to process Dockerfile

I trying to create Dockerfile file from scratch on Windows7. However, currently have trouble on very first step. My Dockerfile is placed under C:\Users\Arturas\Docker\Jenkins. Virtual Box shared folder path on c:\Users and folder name on c/Users (defaults from boot2docker was not changed).
When I run (on git bash):
$ docker build --file Docker/Jenkins/ .
I get:
unable to process Dockerfile: read C:\Users\Arturas\Docker\Jenkins:
The handle is invalid.
Dockerfile content is just one line:
FROM jenkins
I just started learning Docker so my experience is very limited yet. However from tools like boot2docker I expect basic commands to work out of the box so I must be missing something.
Try instead:
cd /C/Users/Arturas/Docker/Jenkins
docker build -t myimage .
I assume here that you have a file named Dockerfile under the Jenkins folder.
The -f option of a docker build is for referencing the Dockerfile (if it is named differently for instance)
Don't forget to use the latest docker-machine (the 0.5.4 one: an auto-extractible exe docker-machine_windows-amd64.exe): it uses a VM named boot2docker.iso through VirtualBox.
Try to specify the "Dockerfile" name
$ docker build --file Docker/Jenkins/Dockerfile .

Resources