Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.5K
Vistas
.gitlab-ci.yml error: "apk: command not found"

I have the following .gitlab-ci.yml file:

image: docker

services:
  - docker:dind

stages:
  - test
  - build
  - deploy

test:
  stage: test
  before_script:
    - apk add --update -y python-pip
    - pip install docker-compose
  script:
    - echo "Testing the app"
    - docker-compose run app sh -c "python manage.py test && flake8"

build:
  stage: build
  only:
    - develop
    - production
    - feature/deploy-debug-gitlab
  before_script:
    - apk add --update -y python-pip
    - pip install docker-compose
  script:
    - echo "Building the app"
    - docker-compose build

deploy:
  stage: deploy
  only:
    - master
    - develop
    - feature/deploy
    - feature/deploy-debug-gitlab
  before_script:
    - apk add --update -y python-pip
    - pip install docker-compose
  script:
    - echo "Deploying the app"
    - docker-compose up -d
  environment: production
  when: manual

When the Gitlab runner executes it, I get the following error:

$ apk add --update -y python-pip
bash: line 82: apk: command not found
ERROR: Job failed: exit status 1

How am I supposed to install apk? Or what image other than docker should I be using to run this gitlab-ci.yml file?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Well, it turns out I had two different runners: one marked as "shell executor" (Ubuntu) and the other marked as "docker executor“.

This error was being thrown out only when the Ubuntu runner was dispatching the job, since Ubuntu doesn´t come with apk.

I disabled the Ubuntu runner and solved the problem.

over 4 years ago · Santiago Trujillo Denunciar

0

The alternative is to set your installation on step above test, as in this issue

image: docker:latest

services:
- docker:dind

before_script:
- apk add --update python-pip
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda