How do I run a local executable in Gitlab CI?

116 Views Asked by At

Quite lost with this one. I can demonstrate the issue with this simple Gitlab CI:

image:
  name: docker/compose:1.29.0
  entrypoint: ['']

variables:
  DOCKER_HOST: tcp://docker:2375/
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""

stages:
  - build

build:
  stage: build
  script:
    - cp /root/temp/smctl smctl
    - ls -ltrh
    - chmod +x smctl
    - ./smctl --help

I get the following result:

  1. File gets copied

  2. ls shows the smctl file exists in the current directory

  3. When I try to run the executable, I get the following error:

    /bin/sh: eval: line 154: ./smctl: not found

What is going on here? Thanks

1

There are 1 best solutions below

4
Ferhat On

Check that the packet is installed on the docker image docker/compose:1.29.0 and not on the host machine, otherwise you'll need to install it either with before_script or directly in script.