Click here to Skip to main content
15,877,711 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am new to gitlab-runner and docker. I am trying to automate my project using CI/CD pipelines. I am referring to this article. (But I have modified Dockerfile and setup.sh a bit as the post is too old hence some of the things were not working or were deprecated).

And I am getting this error in my gitlab pipeline:
Shell
Running with gitlab-runner 15.4.0 (43b2dc3d)
  on Generic debian wheezy package build runner r1Z1sTLv
Preparing the "docker" executor
Using Docker executor with image generic-package-build-runner:v1 ...
Pulling docker image registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:arm64-43b2dc3d ...
Using docker image sha256:b7934566c48e2f47719fe08bbfb89d92b8ad4181ffdc6592f2a25cefab0c284e for registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:arm64-43b2dc3d with digest registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper@sha256:358a57cd8617424239fcfdffd9a47ebca6e72d0dc940c223af2cec95c77f9bbd ...
Pulling docker image generic-package-build-runner:v1 ...
WARNING: Failed to pull image with policy "always": Error response from daemon: pull access denied for generic-package-build-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied (manager.go:235:3s)
ERROR: Job failed: failed to pull image "generic-package-build-runner:v1" with specified policies [always]: Error response from daemon: pull access denied for generic-package-build-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied (manager.go:235:3s)


What I have tried:

<pre>I have used this command to make docker image:

docker build -t generic-package-build-runner:v1 .


I used this command to register the gitlab-runner
gitlab-runner register \
--non-interactive \
--url "SOMEURL" \
--registration-token "SOMETOKEN" \
--description "Generic debian wheezy package build runner" \
--executor "docker" \
--docker-image "generic-package-build-runner:v1"


where I have replaced SOMEURL and SOMETOKEN with actual placeholders.

My docker files is:

FROM dockette/wheezy
ADD  setup.sh /opt/  
RUN  /bin/bash /opt/setup.sh


setup.sh
deb http://archive.debian.org/debian wheezy main contrib non-free
deb http://archive.debian.org/debian-archive/debian-security/ wheezy/updates main contrib non-free
deb [arch=armhf] http://repos.rcn-ee.com/debian/ wheezy main
yes | apt-get update 
yes | apt-get --force-yes install git dh-make build-essential autoconf autotools-dev


gitlab-ci.yml
# Is performed before the scripts in the stage step
before_script:  
  - source /etc/profile
  - echo "Hello, $GITLAB_USER_LOGIN!"
  - echo "Hello, $GITLAB_USER_PASSWORD"
#  - sudo rm /var/cache/apt/archives/lock
#  - sudo rm /var/lib/dpkg/lock
#  - sudo su
#  - sudo -S su < $password_secret

# Defines stages which are to be executed
stages:  
  - build

# Stage "build"
run-build:  
  stage: build
  script:
#    - apt-get install -y libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
    - autoreconf -fvi
    - cp COPYING debian/copyright
    - dpkg-buildpackage -us -uc
    - mkdir build
    - mv ../goaccess*.deb build/

  # This stage is only executed for new tags
  only:
    - tags

  # The files which are to be made available in GitLab
  artifacts:
    paths:
      - build/*
Posted
Updated 6-Dec-22 23:11pm
Comments
Richard Deeming 6-Dec-22 6:49am    
"repository does not exist or may require 'docker login'"

Have you verified that the repository exists, and that the account you're using to access it has the appropriate permissions?
Member 15435238 7-Dec-22 5:11am    
So I had to my custom image on the hub and then it worked

1 solution

So I had to my custom image on the hub and then it worked
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900