How to set bash aliases for docker containers in D

2020-02-17 04:30发布

I am new to docker. I found that we can set environment variables using ENV instruction in the Dockerfile. But how does one set bash aliases for long commands in Dockerfile?

7条回答
We Are One
2楼-- · 2020-02-17 05:21

You can use entrypoint, but it will not work for alias, in your Dockerfile:

ADD dev/entrypoint.sh /opt/entrypoint.sh
ENTRYPOINT ["/opt/entrypoint.sh"]

Your entrypoint.sh

#!/bin/bash
set -e

function dev_run()
{

}

export -f dev_run

exec "$@"

(Quick copy/paste, sorry)

查看更多
登录 后发表回答