docker: command not found

adam_dwvd
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 25, 2023

I'm really at a loss here, for some reason I keep getting the following error when I try to use atlassian/scp-deploy:1.4.1 for deploying a tar file.

 

My YML:

 

image: node:18.16.0

options:

max-time: 15

docker: true

definitions:

caches:

npm: $HOME/.npm

services:

docker:

memory: 3072

steps:

- step: &NodeProd

name: Build Production

# image: node:18.16.0

script:

- cd ./app

- npm ci

- npm run build

- cd ..

- tar -zcf build.tar.gz ./app

artifacts:

- ./build.tar.gz

caches:

- npm

- step: &DeployProd

image: atlassian/default-image

services:

- docker

script:

- docker version

- pipe: atlassian/scp-deploy:1.4.1

variables:

USER: $USER

SERVER: $IP

REMOTE_PATH: $PATH

LOCAL_PATH: './theme.tar.gz'

DEBUG: 'true'

branches:

main:

- step: *NodeProd

- step:

<<: *DeployProd

name: "Deployment to Production"

trigger: automatic

deployment: production

 

As soon as it hits the deploy step it errors out on `docker version` with the following error output:

+ docker version

bash: docker: command not found

bash: lesspipe: command not found

bash: dircolors: command not found

 

As far as I know I'm doing everything according to the book and I have other pipelines where I dont explicitly have declared the docker service and it seems to work.

I initially opted to just use scp, but apparently I'm also getting a "scp: command not found", hence the reason i opted for scp-deploy but that also doesn't seem to work.

So what am I doing wrong here?

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 26, 2023

Hello @adam_dwvd and welcome to the Community!

From the symptoms of the issue, I think you might have an user-defined environment variable configured either at the workspace, repository, or deployment level that is replacing the PATH variable, causing the shell to not find the docker binary inside the image.

So I would suggest checking if a variable named PATH does exist and if yes, either delete it or rename it. The default PATH environment variable where the binaries exist can get overridden with this user-supplied PATH variable, and therefore result in these binaries not being able to be located.

Thank you, @adam_dwvd !
Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events