Set alias to docker run

docker

#1

I would like to set an alias in my circleci.yml so my scripts do not need to change between local and circleci:
machine:
pre:
- sudo curl -L -o /usr/bin/docker ‘https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci
- sudo chmod 0755 /usr/bin/docker
- alias terraform=“docker run -ti --rm -v $PWD:/data quay.io/librelabs/terraform-cli
- printenv | grep terraform

It does not get set add all and the build fails on printenv - what can I set alias in circileci?


#2

Hi,

Each command you have in circle.yml is run in it’s own shell. The alias would last only for that single command. If you really wanted to do that, you could in a separate shell script.


#3

But in the machine section one can set env vars that persist in the sub shells. How can we set an alias or even source a bash script in the machine settings such that they persist throughout?


#4