Git Product home page Git Product logo

Comments (13)

rhatdan avatar rhatdan commented on July 17, 2024 1

I agree that should be the default behaviour, and not doing this is a bug.

podman build -t foobar
podman run foobar

Should work.

from podman.

baude avatar baude commented on July 17, 2024

can you replicate this outside devcontainers? like with a containerfile ?

from podman.

rhatdan avatar rhatdan commented on July 17, 2024

This looks like you did not fully specify the image name, just used a short name?

from podman.

AndesKrrrrrrrrrrr avatar AndesKrrrrrrrrrrr commented on July 17, 2024

@baude, I haven't tried, the issue seems to be short name resolution anyways.

@rhatdan, I did not specify anything, rather it's the devcontainer cli pulling from a locally built layer.

Is it wrong of me to assume that we should search locally first for short-names? I would've expected this if the image being pulled is of a conventional registry form (e.g. foo/bar)... I guess it's all a repositories, slashes or not. Nonetheless, I would expect local-first search before asking for for registry selection.

Also, why isn't localhost/vsc-cli-* an option? I can copy the string and run locally with

podman run --rm -it vsc-cli-*

I could post an issue to the devcontainer cli asking to prefix the image pull with localhost/... 🤔

from podman.

AndesKrrrrrrrrrrr avatar AndesKrrrrrrrrrrr commented on July 17, 2024

Here's some sample output during devcontainer build in the https://github.com/devcontainers/cli repo:

podman build -f /tmp/devcontainercli-person/updateUID.Dockerfile-0.65.0 -t vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006-uid --platform linux/amd64 --build-arg BASE_IMAGE=vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006 --build-arg REMOTE_USER=node --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=node /tmp/devcontainercli-person/empty-folder
STEP 1/9: FROM vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006
? Please select an image: 
  ▸ registry.fedoraproject.org/vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006:latest
    registry.access.redhat.com/vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006:latest
    docker.io/library/vsc-cli-4ee3098167f24595df8161e2a6a226ab0bfe78567231ed22d21f0f0d45a5d006:latest

from podman.

rhatdan avatar rhatdan commented on July 17, 2024

@vrothberg PTAL

from podman.

vrothberg avatar vrothberg commented on July 17, 2024

git clone -b feat/local-dev https://github.com/island-is/island.is

The branch doesn't exist anymore. I assume it has been merged?

from podman.

vrothberg avatar vrothberg commented on July 17, 2024

Here's some sample output during devcontainer build in the https://github.com/devcontainers/cli repo:

Works on my end. Did you configure /etc/containers/registries.conf? For instance, the short-name-mode option?

from podman.

vrothberg avatar vrothberg commented on July 17, 2024

Note: requires installing the podman-docker package as it seems that devcontainer shells out to the client rather than using the socket.

from podman.

AndesKrrrrrrrrrrr avatar AndesKrrrrrrrrrrr commented on July 17, 2024

The branch doesn't exist anymore

Yes, merged to main. I updated the description.

Did you configure /etc/containers/registries.conf?

Hmm... It seems like, I did configure my registry.conf:

# # An array of host[:port] registries to try when pulling an unqualified image, in order.
# unqualified-search-registries = ["example.com"]
unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "docker.io"]

Nonetheless, I'm would still expect localhost to be searched for short-name image pulls.

from podman.

AndesKrrrrrrrrrrr avatar AndesKrrrrrrrrrrr commented on July 17, 2024

I added localhost to the unqualified-search-registries, and seems to have fixed the issue.

Again, I would like for localhost to be searched even if it weren't in the list

from podman.

AndesKrrrrrrrrrrr avatar AndesKrrrrrrrrrrr commented on July 17, 2024

Should this also work?

podman build -t foobar

cat <<EOF >> Containerfile.dynamic
FROM foobar
RUN cowsay
EOF

podman build -f Containerfile.dynamic

I would expect so, but apparently it doesn't. This is what devcontainers does; builds an image, then uses it in a dynamically generated containerfile, which is what is causing this issue.

from podman.

rhatdan avatar rhatdan commented on July 17, 2024
$ cat /tmp/Containerfile
from alpine
run echo hi
$ podman build -t foobar /tmp
STEP 1/2: FROM alpine
STEP 2/2: run echo hi
--> Using cache f2222d280005d435f8debfcfdf9809893feeb0bad4f35504801017de87714622
COMMIT foobar
--> f2222d280005
Successfully tagged localhost/foobar:latest
f2222d280005d435f8debfcfdf9809893feeb0bad4f35504801017de87714622
 $ podman images | grep foobar
localhost/foobar          latest      f2222d280005  2 minutes ago       8.09 MB
$ cat /tmp/Containerfile.dynamic 
from foobar
run echo hi again
$ podman build -f /tmp/Containerfile.dynamic -t foobar1 /tmp
STEP 1/2: FROM foobar
STEP 2/2: run echo hi again
hi again
COMMIT foobar1
--> 68f7823fd0dc
Successfully tagged localhost/foobar1:latest
68f7823fd0dc5eae28725e908ffbc8fde549762490221b2469e59f48535dece7
podman images | grep foobar
localhost/foobar1         latest      68f7823fd0dc  3 minutes ago  8.09 MB
localhost/foobar          latest      f2222d280005  4 minutes ago  8.09 MB

from podman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.