Azure / terraform-azurerm-aci-devops-agent

Terraform Module to deploy a Azure DevOps self-hosted agents on Azure Container Instance
MIT License
94 stars 66 forks source link

Docker Image fails to start #34

Closed clbarrett closed 2 years ago

clbarrett commented 2 years ago

I am using the provided Dockerfile and am getting this error when I try and run the image both locally and in the container.

exec ./start.sh: no such file or directory

Any idea what's going on here? And how to fix it?

jcorioland commented 2 years ago

Hi, can you share exactly what command you are using to build and run it locally? I've just tested from master with the following:

cd docker/linux
docker build -t test-aci-devops-linux .
 docker run -e AZP_URL="https://dev.azure.com/YOUR_ORG_NAME" \
  -e AZP_POOL="POOL_NAME" \
  -e AZP_AGENT_NAME="AGENT_NAME" \
  -e AZP_TOKEN="PERSONAL_ACCESS_TOKEN" test-aci-devops-linux

And that works: image

Note: just a kind reminder that docker images are not updated in this repo, and that you should update to new one, following this docs.

clbarrett commented 2 years ago

Thanks for the link. I've bookmarked it.

This is what I get when I run the command with my own org details filled for the AZP_...

image

For clarity, I am using Git-Bash to run the docker build & docker run commands.

jcorioland commented 2 years ago

that works for me from Git Bash too:

image

Any chance you can try to rebuild the Docker image? And maybe try on another machine just to double check ? What Docker version are you using? Here's mine:

Client: Docker Engine - Community
 Cloud integration: v1.0.24
 Version:           20.10.14
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 24 01:48:21 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop
 Engine:
  Version:          20.10.14
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       87a90dc
  Built:            Thu Mar 24 01:46:14 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.11
  GitCommit:        3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc:
  Version:          1.0.3
  GitCommit:        v1.0.3-0-gf46b6ba
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
clbarrett commented 2 years ago

In a weird turn of events... my problem was line endings. One of my editors must've given windows style (\r\n) line endings to the start.sh file. Once I restored them back to Linux style (\n) it worked. Thanks for the speedy help.