Docker覆盖entrypoint

在使用docker简化编译环境搭建过程中碰到一个问题是 pull下来的镜像默认提供entrypoint,自动对指定的目录进行编译(运行make)。
但是在实际使用过程中,可能需要带参数或者make不同的目标。
因为需要屏蔽掉默认的entrypoint。

屏蔽方法是:

# 进入镜像的, 运行bash
docker run -it --entrypoint /bin/bash [docker_image]

# 在上面基础上运行自己想要的指令,如
docker run -it --entrypoint /bin/bash -c "cd /code && make -j8 && make flash" [docker_imag】

分享