Concourse를 사용해 보았습니다.
1. 컨테이너 간의 ssh 키 생성
키 생성
mkdir -p keys/web keys/worker
ssh-keygen -t rsa -f ./keys/web/tsa_host_key -N ''
ssh-keygen -t rsa -f ./keys/web/session_signing_key -N ''
ssh-keygen -t rsa -f ./keys/worker/worker_key -N ''
ssh-keygen -t rsa -f ./keys/worker/darwin_worker_key -N ''
cat ./keys/worker/worker_key.pub >> ./keys/web/authorized_worker_keys
cat ./keys/worker/darwin_worker_key.pub >> ./keys/web/authorized_worker_keys
cp ./keys/web/tsa_host_key.pub ./keys/worker
만든 키 목록
keys/web/session_signing_key
keys/web/session_signing_key.pub
keys/web/authorized_worker_keys
keys/web/tsa_host_key
keys/web/tsa_host_key.pub
keys/worker/worker_key
keys/worker/worker_key.pub
keys/worker/darwin_worker_key
keys/worker/tsa_host_key.pub
keys/worker/darwin_worker_key.pub
2. docker-compose.yml
docker-compose.yml
version: '3'
services:
concourse-db:
image: postgres:9.5
environment:
POSTGRES_DB: concourse
POSTGRES_USER: concourse
POSTGRES_PASSWORD: changeme
PGDATA: /database
concourse-web:
image: concourse/concourse
links: [concourse-db]
depends_on: [concourse-db]
command: web
restart: unless-stopped
ports: ["8080:8080", "2222:2222"]
volumes: ["./keys/web:/concourse-keys"]
environment:
#CONCOURSE_EXTERNAL_URL: "${CONCOURSE_EXTERNAL_URL}"
CONCOURSE_BASIC_AUTH_USERNAME: concourse
CONCOURSE_BASIC_AUTH_PASSWORD: changeme
CONCOURSE_POSTGRES_HOST: concourse-db
CONCOURSE_POSTGRES_USER: concourse
CONCOURSE_POSTGRES_DATABASE: concourse
CONCOURSE_POSTGRES_PASSWORD: changeme
concourse-worker:
image: concourse/concourse
privileged: true
links: [concourse-web]
depends_on: [concourse-web]
command: worker
volumes: ["./keys/worker:/concourse-keys"]
environment:
CONCOURSE_TSA_HOST: concourse-web
시작
docker-compose up -d
3. fly 명령 취득
http://localhost:8080로 이동하여 fly 다운로드
fly에 concourse 등록
./fly -t concourseci login -c http://localhost:8080
targets
$ ./fly targets
name url team expiry
concourseci http://localhost:8080 main Sun, 10 Sep 2017 21:19:48 UTC
작업자 목록 표시
$ ./fly -t concourseci workers
name containers platform tags team state version
b8854618b82c 0 linux none none running 1.2
4. 어떤 명령만 실행하기 위한 pipeline을 등록해 봅니다.
pipeline2.yml (쓰는 방법 1)
---
jobs:
- name: hello-world
plan:
- task: run-tests
config:
platform: linux
image_resource:
type: docker-image
source:
repository: ubuntu
run:
path: /bin/bash
args:
- -c
- |
echo "Hello, world"
pipeline2.yml (쓰기 2)
---
jobs:
- name: hello-world
plan:
- task: say-hello
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu}
run:
path: echo
args: ["Hello, world!"]
pipeline 등록
./fly -t concourseci set-pipeline -c pipeline2.yml -p hello-world
./fly -t concourseci unpause-pipeline -p hello-world
5. pipeline 삭제
./fly -t concourseci ps
./fly -t concourseci dp -p パイプライン名
작업자 삭제
./fly -t concourseci workers
./fly -t concourseci prune-worker -w ワーカー名
6. worker에 네이티브 Linux 추가
htps : // 기주 b. 코 m / 콘코 rse / 콘코 rse / 레 에세 s / 에서
concourse_linux_amd64
다운로드sudo ./concourse worker \
--name native1 \
--work-dir ./working \
--tsa-host 127.0.0.1 \
--tsa-public-key ./keys/worker/tsa_host_key.pub \
--tsa-worker-private-key ./keys/worker/darwin_worker_key
아래와 같은 로그가 출력됩니다.
{"timestamp":"1504994760.335169315","source":"tsa","message":"tsa.connection.channel.forward-worker.register.done"...
native1이 추가되었는지 확인
$ ./fly -t concourseci workers
name containers platform tags team state version
b8854618b82c 0 linux none none running 1.2
native1 0 linux none none running 1.2
사용법은 잘 모릅니다.
Reference
이 문제에 관하여(Concourse를 사용해 보았습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tukiyo3/items/6e59cd5601ab923ff41d텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)