Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl command not found on .gitlab-ci.yml

I have a .gitlab-ci.yml file. Its creating some docker images and pushing it to AWS ECR.

When I am running curl command to push some artifacts to remote repository it says curl: not found. I am already using openjdk image to do ./gradlew build. Don't know how to install curl on Gitlab runner.

Please guide.

like image 621
Abhinav Mutreja Avatar asked Sep 04 '17 05:09

Abhinav Mutreja


2 Answers

If you're using docker:dind, you can do the following as @Abhinav Mutreja mentioned.

image: docker:stable

services:
  - name: docker:dind

stages:
  - example

example:
  stage: example
  before_script:
    - apk add --update curl && rm -rf /var/cache/apk/*
  script:
    - >
      curl google.com
like image 92
gpresland Avatar answered Oct 10 '22 09:10

gpresland


I was able to resolve it by using apk utility.

apk add --update curl && rm -rf /var/cache/apk/*
like image 36
Abhinav Mutreja Avatar answered Oct 10 '22 08:10

Abhinav Mutreja