gpt4 book ai didi

bash - 如何在 Dockerfile 中设置 .bash_profile 环境变量?

转载 作者:行者123 更新时间:2023-11-29 09:51:58 24 4
gpt4 key购买 nike

我想在Dockerfile中设置bash环境变量。
我该怎么做?

主机:OS X 10.11.4
访客:ubuntu:latest

docker 文件:

RUN mkdir ~/gopath_dir
RUN apt-get install ubuntu-make
RUN umake go

# I want to set $GOPATH to ~/gopath_dir

最佳答案

您可以使用 ENV 语句声明一个环境变量

ENV foo=hello

关于bash - 如何在 Dockerfile 中设置 .bash_profile 环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37237963/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com