-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rc
21 lines (20 loc) · 1.06 KB
/
.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function mix() {
ELIXIR_VERSION=${ELIXIR_VERSION:-1.15.6}
DOCKER_IMAGE=elixir:${ELIXIR_VERSION}
DOCKER_RUN_OPTS="--rm -it --network host -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} -e HEX_HOME=${PWD} -e MIX_HOME=${PWD} -e UOF_BASE_URL -e UOF_AUTH_TOKEN -e HEX_API_KEY ${DOCKER_RUN_EXTRA_OPTS}"
if [ -n "$ZSH_VERSION" ]; then
docker run ${=DOCKER_RUN_OPTS} ${DOCKER_IMAGE} mix "$@"
else
docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE} mix "$@"
fi
}
function iex() {
ELIXIR_VERSION=${ELIXIR_VERSION:-1.15.6}
DOCKER_IMAGE=elixir:${ELIXIR_VERSION}
DOCKER_RUN_OPTS="--rm -it --network host -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -u $(id -u):$(id -g) -v ${PWD}:${PWD} -w ${PWD} -e HEX_HOME=${PWD} -e MIX_HOME=${PWD} -e UOF_BASE_URL -e UOF_AUTH_TOKEN ${DOCKER_RUN_EXTRA_OPTS}"
if [ -n "$ZSH_VERSION" ]; then
docker run ${=DOCKER_RUN_OPTS} ${DOCKER_IMAGE} iex "$@"
else
docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE} iex "$@"
fi
}