Compose: service_run_ + 1

์— ๋งŒ๋“  2017๋…„ 03์›” 31์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: docker/compose

๋™์‹œ์— run php ์„œ๋น„์Šค์— ๋Œ€ํ•ด ๋‘ ๊ฐœ์˜ cronjob์ด ์žˆ์Šต๋‹ˆ๋‹ค.

ํ•˜๋‚˜์˜ run ๋ช…๋ น ๋งŒ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค.

Cannot create container for service php: Conflict. The container name "/folder_php_run_1" is already in use by container {hashhere}. You have to remove (or rename) that container to be able to reuse that name.
Command exited with non-zero status 1
arerun kinbug

๋ชจ๋“  3 ๋Œ“๊ธ€

์ด๋Š” ์•„๋งˆ๋„ ๊ฐ€์šฉ์„ฑ์„ ํ™•์ธํ•˜๋Š” ์‹œ๊ฐ„๊ณผ ์‹ค์ œ๋กœ create ๋ช…๋ น์„ ์‹คํ–‰ํ•˜๋Š” ์‹œ๊ฐ„ ์‚ฌ์ด์— ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ƒ์„ฑ๋˜๊ณ  ์žˆ์Œ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ํ•ด๊ฒฐ์ฑ…์€์ด ๋‘ ์ž‘์—…์„ ์•ฝ๊ฐ„ ๋‹ค๋ฅธ ์‹œ๊ฐ„์— ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค (5 ์ดˆ ๊ฐ„๊ฒฉ์ด๋ฉด ์ถฉ๋ถ„ํ•  ์ˆ˜ ์žˆ์Œ).

๋‹ค๋ฅธ tmux ํƒญ์—์„œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋ฐฉ์‹์œผ๋กœ docker-compose up foo bar & docker-compose up baz bar ํ•˜์—ฌ์ด ๋ฌธ์ œ๋„ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์ƒ์„ฑ์— ์‹คํŒจํ•˜๋ฉด ๊ฒ€์‚ฌ๋ฅผ ๋‹ค์‹œ ์‹คํ–‰ํ•˜๊ณ  ์—ฐ๊ฒฐ์„ ์‹œ๋„ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

๋งค์šฐ ๊ฐ„๋‹จํ•œ ์žฌํ˜„ ์‚ฌ๋ก€ :

โžค cat docker-compose.yml 
version: "2.2"
services:
  test:
    image: alpine

โžค docker-compose run --rm test true
Creating network "test_default" with the default driver

โžค docker-compose run --rm test docker-compose run --rm test true &; docker-compose run --rm test true
ERROR: Cannot create container for service test: Conflict. The container name "/test_test_run_1" is already in use by container "76db8705667961966468d66d0667417862ad6edb3fb4c09b95a8ebab4ec36bf8". You have to remove (or rename) that container to be able to reuse that name.
Job 4, 'docker-compose run --rm test doโ€ฆ' has ended

์ œ ๊ฒฝ์šฐ ๋ฌธ์ œ๋Š” ๋‚ด๋ถ€ ์ผ์ •์— ๋”ฐ๋ผ ๋ณ‘๋ ฌ ์ž‘์—…์„ ํŠธ๋ฆฌ๊ฑฐํ•˜๋Š” CI์ž…๋‹ˆ๋‹ค. ์ด ๋•Œ๋ฌธ์— ์ผ์ •์„ ํ•ดํ‚นํ•ด์•ผํ•˜๋Š” ๊ฒƒ์€ ๋งค์šฐ ์Šฌํ”ˆ ์ผ์ž…๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰