I’ve been using Docker and Docker Desktop on Windows for a couple of months, but I feel I’m still very new to this. Yesterday I installed Linux on my machine (KDE Neon) and installed Docker and Docker-compose along with it.
One of the docker images I sometimes use to test a php project is this one: mattrayner/lamp. On Windows, I just type in the following command in order to create a persistent app and mysql folder:
However, now that I’m on Linux I get the following error:
Unable to find image 'code:latest' locally
docker: Error response from daemon: pull access denied for code, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
But the image does exist (it works on Windows) and does not require ‘docker login’.
It looks like it has something to do with the app and mysql params that are passed to the -v arguments, because the command does work without them (but then I don’t have the app and mysql folders on my system).
Can someone help me out here? Is there some syntax difference between Linux and Windows commands?
If a command uses a variable with spaces, it will be expanded to multiple strings (1+number of spaces). If quoted the variable value will be treated as a single string, regardless of the spaces.
However, I am a bit confused… There aren’t any spaces within that param. So why should this be a problem here?
Or do you mean the variable ${PWD} is containing spaces?
I am dealing with a similar issue. Can you break down the error message? What is ‘docker run’ looking for first? The Dockerfile? What makes it look for the :latest (as listed in the second section below)?
When I first ran docker build (docker build -t lnbits .) it gave me a warning:
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
I ignored it thinking this was not fatal, just telling me the data is in memory to be used later.
I ran the docker run command and it fails with this posts error:
Unable to find image ‘lnbits:latest’ locally
docker: Error response from daemon: pull access denied for lnbits, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.
See ‘docker run --help’.
Then when I saw this post, I added the " " although I didn’t have spaces in $PWD.
just to clarify I mixed up the postings above - you’ll see two entries - a docker run and a docker build - out of order above. I see I also wrote run/build interchangeably above.
I didn’t realize the docker build failed until the docker run failed because I thought the docker build warning wasn’t fatal (noob here).
dme1sc@dme1sc:~/lnbits$ docker build -t lnbits .
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 28.5s (16/16) FINISHED
=> [internal] load build definition from Dockerfile 1.2s
=> => transferring dockerfile: 1.15kB 0.0s
=> [internal] load .dockerignore 1.3s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.7-slim 1.6s
=> CACHED [builder 1/9] FROM docker.io/library/python:3.7-slim@sha256:c2cc09c3de 0.0s
=> => resolve removedforforumrules/library/python:3.7-slim@sha256:c2cc09c3de140f59b3065b951 0.4s
=> [internal] load build context 1.1s
=> => transferring context: 9.75MB 0.8s
=> CACHED [builder 2/9] RUN python -m venv /opt/venv 0.0s
=> CACHED [builder 3/9] RUN apt-get update 0.0s
=> CACHED [builder 4/9] RUN apt-get install -y --no-install-recommends build-ess 0.0s
=> CACHED [builder 5/9] COPY requirements.txt /tmp/requirements.txt 0.0s
=> CACHED [builder 6/9] RUN python -m pip install --upgrade pip 0.0s
=> CACHED [builder 7/9] RUN pip install -r /tmp/requirements.txt 0.0s
=> CACHED [builder 8/9] RUN pip install pylightning 0.0s
=> [builder 9/9] RUN pip install lndgrpc purerpc 15.5s
=> [lnbits 2/4] COPY --from=builder --chown=1000:1000 /opt/venv /opt/venv 2.8s
=> [lnbits 3/4] WORKDIR /app 1.2s
=> [lnbits 4/4] COPY --chown=1000:1000 lnbits /app/lnbits 1.6s
dme1sc@dme1sc:~/lnbits$
To tell you the truth I don’t exactly know what that warning is. Buildkit is very powerful tool which is very good at ruining the build… I really liked it, but there is so much problem with it recently. I can’t believe it became so popular.
If your Dockerfile support building without buildkit, then try this to at least get another error message:
DOCKER_BUILDKIT=0 docker build -t Inbits .
I edited your comment to use the </> button to highlight the code and the comment disappeared This is my first edit, I don’t know what happened, sorry
These are misterious issues. I haven’t really had a problem personally but I helped others who had. There were many issue here on the forum I couldn’t explain and at the end, the solution was disabling buildkit. There was one case a year ago or so, when someone had a problem with the volume autoremoval. It was so complex and strange error, I almost failed to find the cause. I tried to reproduce the error but couldn’t. Only with one image. The one, the user used who asked for help. It turned out that image was built with buildkit and it changed how it worked. I don’t remember the exact problem but that shouldn’t happen. It wasn’t the build process when the problem ocured, but it affected the it could be used later.
Thanks for sharing! I must admit personaly I have nothing but good experience with buildkit. I can see how troubleshooting problems related to buildkit itself would be a challenge.
Wow - you guys are awesome!
docker build -t lnbits --load .
This worked. I had tried the --load but I was putting it after BUILD. I didn’t even think about putting it after ‘lnbits’.
It ran successfully.