safe way to use build-time argument in Docker

后端 未结 3 1133
隐瞒了意图╮
隐瞒了意图╮ 2020-12-18 04:38

I have a build time Argument with which I would like to build my Docker file; Since that argument is confidential in nature (github key of a private repo) I don\'t want that

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 04:51

    With docker 18.09+, that will be: docker build --secret id=mysecret,src=/secret/file (using buildkit).

    See PR 1288, announced in this tweet.
    --secret is now guarded by API version 1.39.

    Example:

    printf "hello secret" > ./mysecret.txt
    
    export DOCKER_BUILDKIT=1
    
    docker build --no-cache --progress=plain --secret id=mysecret,src=$(pwd)/mysecret.txt -f - . <

提交回复
热议问题