The issue
As I wrote in the title, everytime I use Docker in Windows 11 I run into this error:
exec: “docker-credential-desktop”: executable file not found in %PATH%, out: “
This happens with every step, build included.
I know that this can be bypassed by modifying the config.json file, but I’m looking for a permanent fix. Modifying the file only works once, if I reboot the issue is still there.
Context, if that matters, is this: I’m working with Docker, building mostly NodeJS applications and pushing them to a AWS repository (aka ECR).
I will deeply appreciate every suggestion!
How to reproduce
Below the steps to reproduce my issue. You will need a Dockerfile which could be as simple as this (it describes an image of a NodeJS app, written in Typescript):
FROM node:alpine3.18
WORKDIR /home/euronovate/wlazyformBackend
COPY package*.json ./
COPY tsconfig*.json ./
COPY /src/* ./src/
COPY .env ./.env
RUN npm install
RUN npm run build
RUN rm src/* && rmdir src
RUN rm *.json
RUN npm prune --production
EXPOSE 3000
ENTRYPOINT [ "node", "build/index.js"]
To reproduce this issue:
- Have a Windows PC with Docker Desktop Installed
- Open a terminal near any Dockerfile
- Run the command “docker build .”
- Let it fail
- Open the file “config.json” in “C:UsersUSERNAME.dockerconfig.json” (with USERNAME=your username on the machine)
- Delete the line “credsStore”
- Re-run the command. Now the command will execute