localstack / localstack/serverless-localstack

Specify profile for docker compose in config

オープン
#265 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement status: backlog
主要言語
JavaScript
スター
542
フォーク
92
PR マージ指標
30日以内にマージされた PR はありません

説明

Problem

I have multiple profiles configured in my docker-compose.yml file. I would like to only run the containers tagged with a particular profile with via this plugin's docker compose up command.

Example

Example compose file:

# docker-compose.yml
services:
  localstack:
    profiles:
      - local
    container_name: '${LOCALSTACK_DOCKER_NAME:-localstack-main}'
    image: localstack/localstack
    ports:
      - 4566:4566 # LocalStack Gateway
      - 4510-4559:4510-4559 # external services port range
    environment:
      # LocalStack configuration: https://docs.localstack.cloud/references/configuration/
      - DEBUG=${DEBUG:-0}
    volumes:
      - '${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack'
      - '/var/run/docker.sock:/var/run/docker.sock'

  redis-local:
    profiles:
      - local
    image: redis:7.2.4-alpine
    ports:
      - 6379:6379
    command: redis-server --logLevel notice --requirepass pass

  redis-test:
    profiles:
      - test
    image: redis:7.2.4-alpine
    ports:
      - 6379:6379
    command: redis-server --logLevel notice --requirepass pass

And the compose up command:

docker compose --profile local up -f docker-compose.yml

Read more about compose profiles here.

When specifying the local profile it shouldn't create the redis-test container.

Suggested solution

Can add an optional parameter to config.docker to specify the profile(s) to be run in the docker compose up command.

e.g.

custom:
  localstack:
    docker:
      profiles:
       - local

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、plugin がカスタムの config.docker をどのように読み取り、docker compose up コマンドを組み立てているかを追跡します。オプションの profile または profiles の値のサポートを追加し、local プロファイルと test プロファイルを含む Compose ファイルを使って、選択したプロファイルだけが起動することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, docker-compose, javascript
領域
devops
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
50/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。