0
0

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 1 year has passed since last update.

僕なりの 環境変数 備忘録

Last updated at Posted at 2024-05-16

全般

システム環境変数とプログラム環境変数がある

システム環境変数→OS自体に

プログラム環境変数 → プログラム毎に

※優先されるのはプログラム環境変数

Docker

docker-compose内の環境変数の話

$ cat .env
TAG=v1.5

$ cat docker-compose.yml
version: '3'
services:
  web:
    image: "webapp:${TAG}"

上の例の場合、docker-compose.ymlを環境変数を置き換えて表示するコマンドdocker-compose configをやると

$ docker-compose config

version: '3'
services:
  web:
    image: 'webapp:v1.5'

のように ${TAG}v1.5に置き換わる。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?