Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing local images #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MayamaTakeshi
Copy link

Hi,
I don't know if this could be useful to others but I have added code to check if an image already exists in the local docker and if yes, to use it instead of pulling it from ghcr.io.
In my case, it simplifies my work as I don't need to push the image to ghcr.io while it is still be being worked on.

@vweevers
Copy link
Member

This is already supported, by -i my-namespace/my-image.

@MayamaTakeshi
Copy link
Author

I could not confirm this works on latest commit 7c0b07e:

takeshi@takeshi-desktop:~/src/git/MayamaTakeshi/sip-lab$ grep prebuildify-cross package-lock.json 
        "prebuildify-cross": "github:prebuild/prebuildify-cross"
    "node_modules/prebuildify-cross": {
      "resolved": "git+ssh://[email protected]/prebuild/prebuildify-cross.git#7c0b07e22110d4cfec147810074ecdfa22638066",
        "prebuildify-cross": "cli.js"
    "prebuildify-cross": {
      "version": "git+ssh://[email protected]/prebuild/prebuildify-cross.git#7c0b07e22110d4cfec147810074ecdfa22638066",
      "from": "prebuildify-cross@https://github.com/prebuild/prebuildify-cross",
takeshi@takeshi-desktop:~/src/git/MayamaTakeshi/sip-lab$ 
takeshi@takeshi-desktop:~/src/git/MayamaTakeshi/sip-lab$ npx prebuildify-cross -i mayamatakeshi/sip-lab-debian11 -t 15.0.0 --strip
npm info using [email protected]
npm info using [email protected]
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/home/takeshi/.nvm/versions/node/v16.17.1/lib/node_modules/npm/npmrc Completed in 0ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/home/takeshi/src/git/MayamaTakeshi/sip-lab/.npmrc Completed in 0ms
npm timing config:load:project Completed in 4ms
npm timing config:load:file:/home/takeshi/.npmrc Completed in 4ms
npm timing config:load:user Completed in 4ms
npm timing config:load:file:/home/takeshi/.nvm/versions/node/v16.17.1/etc/npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 15ms
npm timing npm:load:configload Completed in 15ms
npm timing npm:load:mkdirpcache Completed in 1ms
npm timing npm:load:mkdirplogs Completed in 0ms
npm timing npm:load:setTitle Completed in 2ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 8ms
npm timing npm:load:logFile Completed in 5ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 32ms
/home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/prebuildify-cross/cli.js:12
  if (err) throw err
           ^

Error: pull access denied for mayamatakeshi/sip-lab-debian11, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
    at /home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/docker-remote-api/index.js:59:15
    at ConcatStream.<anonymous> (/home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/concat-stream/index.js:37:43)
    at ConcatStream.emit (node:events:525:35)
    at finishMaybe (/home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:630:14)
    at afterWrite (/home/takeshi/src/git/MayamaTakeshi/sip-lab/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:492:3)
    at processTicksAndRejections (node:internal/process/task_queues:85:21) {
  status: 404
}
npm timing command:exec Completed in 3070ms
npm timing npm Completed in 3172ms

But the image exists:

takeshi@takeshi-desktop:~/src/git/MayamaTakeshi/sip-lab$ docker images |grep 'mayamatakeshi/sip-lab-debian11'
mayamatakeshi/sip-lab-debian11         latest                    fc3a4ebb3ca6   20 hours ago   1.73GB
takeshi@takeshi-desktop:~/src/git/MayamaTakeshi/sip-lab$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants