Set alias to docker run

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?

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.

1 Like

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?