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:
- sudo curl -L -o /usr/bin/docker ‘
- sudo chmod 0755 /usr/bin/docker
- alias terraform=“docker run -ti --rm -v $PWD:/data
- printenv | grep terraform

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



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.


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?