March 25, 2022
docker-compose up redis하면 아래의 에러 메세지Starting redis ... error
ERROR: for redis Cannot start service redis: OCI runtime create failed: container_linux.go:380:
starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76:
mounting "경로1"
to rootfs at "경로2" caused: mount through procfd: not a directory: unknown:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: for redis Cannot start service redis: OCI runtime create failed: container_linux.go:380:
starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76:
mounting "경로1"
to rootfs at "경로2" caused: mount through procfd: not a directory: unknown:
Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.docker-compose -p redis up 하면 아래의 메세지//컨테이너를 처음 띄울 때
Starting redis ... done
Creating [다른 컨테이너] ... done
Attaching to redis, [다른 컨테이너]
redis | 1:C 25 Mar 2022 12:17:13.698 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis | 1:C 25 Mar 2022 12:17:13.699 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
redis | 1:C 25 Mar 2022 12:17:13.699 # Configuration loaded
redis | 1:M 25 Mar 2022 12:17:13.699 * monotonic clock: POSIX clock_gettime
redis | 1:M 25 Mar 2022 12:17:13.701 * Running mode=standalone, port=6379.
redis | 1:M 25 Mar 2022 12:17:13.701 # Server initialized
redis | 1:M 25 Mar 2022 12:17:13.703 * Ready to accept connections
[다른 컨테이너] | yarn run v1.22.5
[다른 컨테이너] | ..//이미 띄워본 적 있고 정지만 시켜놓았을 때
Creating network "redis_default" with the default driver
Creating redis ...
Creating [다른 컨테이너] ... error
Creating redis ... done
fe7430dc2e4b6d0f". You have to remove (or rename) that container to be able to reuse that name.
ERROR: for [다른 컨테이너] Cannot create container for service [다른 컨테이너]: Conflict. The container name "다른 컨테이너" is already in use by container "93935a2555d4386dfdf044....". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.docker-compose run redis
Creating [프로젝트명]_redis_run ... done
1:C 25 Mar 2022 12:18:37.491 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 25 Mar 2022 12:18:37.491 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 25 Mar 2022 12:18:37.491 # Configuration loaded
1:M 25 Mar 2022 12:18:37.492 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 1
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
1:M 25 Mar 2022 12:18:37.494 # Server initialized
1:M 25 Mar 2022 12:18:37.498 * Ready to accept connectionsrun: 서비스에 대해 1회성으로 실행하는 명령어
컨테이너는 잘 떴으나 컨테이너와 동시에 express 서버를 띄워야했다. express 서버를 띄우면 아래와 같은 에러 발생
Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:120:14) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379
}brew install redis → redis-server 85588:C 25 Mar 2022 22:14:16.391 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
85588:C 25 Mar 2022 22:14:16.391 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=85588, just started
85588:C 25 Mar 2022 22:14:16.391 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
85588:M 25 Mar 2022 22:14:16.392 * Increased maximum number of open files to 10032 (it was originally set to 256).
85588:M 25 Mar 2022 22:14:16.392 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 85588
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
85588:M 25 Mar 2022 22:14:16.395 # Server initialized
85588:M 25 Mar 2022 22:14:16.395 * Loading RDB produced by version 6.2.6
85588:M 25 Mar 2022 22:14:16.395 * RDB age 42 seconds
85588:M 25 Mar 2022 22:14:16.395 * RDB memory usage when created 0.98 Mb
85588:M 25 Mar 2022 22:14:16.396 # Done loading RDB, keys loaded: 3, keys expired: 0.
85588:M 25 Mar 2022 22:14:16.396 * DB loaded from disk: 0.001 seconds
85588:M 25 Mar 2022 22:14:16.396 * Ready to accept connections설치가 필요하다는 것을 생각하지 못했다.
설치만으로 redis가 잘 작동되는데 redis 관련 내용이 docker-compose.yml에 있는 이유는? (내가 작성한 코드가 아니어서 전후 맥락을 몰랐다)
출처