Issues updating version when using custom n8n image

Describe the problem/error/question

I had an issue previously of needing to use curl in the execute command node, I was guided through using a custom image for n8n and that worked perfectly. I have now come to update my n8n instance and am getting an error and unsure how to correctly upgrade it now I am using this custom image.

Previous question which gave me the solution and the custom image I am now using

When running docker compose pull I get the below, n8n-curl is the name of the dockerfile which I am using in my image for n8n.

 ✘ Image n8n-curl      Error pull access denied for n8n-curl, repository does not exist or may require 'docker login'                                                                                                                                                                                                                                                 0.8s
Error response from daemon: pull access denied for n8n-curl, repository does not exist or may require 'docker login'

What is the error message (if any)?

 ✘ Image n8n-curl      Error pull access denied for n8n-curl, repository does not exist or may require 'docker login'                                                                                                                                                                                                                                                 0.8s
Error response from daemon: pull access denied for n8n-curl, repository does not exist or may require 'docker login

Information on your n8n setup

  • n8n version: 2.6.3
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker compose
  • Operating system: Linux Ubuntu 22.04 LTS
1 Like

Hi @Hopmister211

docker compose pull only works for images in a registry. Your n8n-curl image is a local custom image, so Docker can’t pull it and shows pull access denied.

To update n8n when using this custom image:

  1. Update your Dockerfile to use the new n8n base image version, for example:

    FROM docker.n8n.io/n8nio/n8n:2.6.3
    
    USER root
    RUN apk --update add curl
    USER node
    
  2. Rebuild the custom image:

    docker build -t n8n-curl:latest .
    
  3. Restart with Docker Compose (no need to pull n8n-curl):

    docker compose down
    docker compose up -d
    

If you keep image: n8n-curl in docker-compose.yml and rebuild it like this, your instance will run the updated n8n version with curl available.

Hi @Hopmister211, welcome back!

I think the reason you are getting this error is that docker compose pull is trying to download the image from the internet,

Since yourn8n-curl is a custom image you built on your own machine, Docker can’t find a repository for it online..

To correctly update your n8n instance, you need to pull the base image for whatever tag you are using (latest/stable/next/beta/ etc..) and then rebuild your custom image,

If you are setting the base image tag to something like stable:

FROM n8nio/n8n:stable

just running the build command will automatically pull the newest version before you redeploy,

Also from my own experience, you can prevent the error from happening on future pulls by adding pull_policy: never right under the image line in your compose:

image

Yeah docker compose pull doesn’t know what to do with locally built images, it only pulls from registries. Instead of pull, just update the version in your Dockerfile’s FROM line to whatever version you want and then run docker compose build --pull which will grab the latest base image and rebuild your custom one on top of it, then docker compose up -d to restart. You can also add pull_policy: build to your compose file for that service so this doesn’t trip you up again in the future.

Hi,

Thank you for your reply!

I amended my n8n-curl dockerfile to now be FROM n8nio/n8n:stable and then ran docker compose down and then docker compose up -d –build and it builds my runners image but doesn’t seem to build the n8n-curl image again so when I load N8N back up in the browser it is still saying I am updates behind. Not sure why it isn’t building the n8n-curl image again