2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

docker エラー (bad flag syntax: -----END)

Posted at

よくAWSにふれるものです。

docker build(run)する際に次のようなエラーにハマりました。

問題

以下のようなコマンド

$ docker build --build-arg PRIVATE_KEY=$PRIVATE_KEY
bad flag syntax: -----END
See 'docker build --help'.

ちなみにPRIVATE_KEYはpem形式です。

-----BEGIN PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
-----END PRIVATE KEY-----

解決

pem形式はスペースを含むので、環境変数には引用符をつけなくてはなりません。

$ docker build --build-arg PRIVATE_KEY="$PRIVATE_KEY"

以上で解決。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?