jira, confluence, 도커[패캠챌린지]

패스트캠퍼스 챌린지 22일차: 도커 이미지만들기(Dockerfile) 및 실행1(인데 삽질기록이 메인)

!ㅁㅇㅇㅁ! 2021. 9. 27. 19:26

--지금 하는게 그걸 팀 규격대로 맞추는중

->다되고 여기에 이론들 적자(?)

 

Aㅏ... 원인 발견.

https://stackoverflow.com/questions/44084846/cannot-connect-to-the-docker-daemon-on-macos

 

Cannot connect to the Docker daemon on macOS

I normally prefer to manage my apps on my OSX with brew I am able to install docker, docker-compose and docker-machine docker --version Docker version 17.05.0-ce, build 89658be docker-compose --v...

stackoverflow.com

 

괜히 docker desktop 안쓰고 cli나 minikube 연습하다 가시밭길 한번 더 걸었다.

생각해보니, 내 로컬 환경은 MacOS인데 CentOS 수준으로 순수한 리눅스 기반처럼 돌아갈 리가 없잖아?

도커 데스크탑으로 안 킬거면 docker-machine도 같이 켜야 하는 거였도다...

-----------------------

 

결국 시간 잡아먹은 부분은 생략. 도커 데스크탑 어플 이거 돈 받아먹을 만 하기는 하구먼...

 

seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run postgres  
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run postgres -e postgres_password=postgres
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name some-postgres -e POSTGRES_PASSWORD=postgres -d postgres
e8de91d6857abf63e5c8fbbfc30eae8a71e96f51e9a82258c89af6587e0e9cdf
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres -d postgres 
docker: Error response from daemon: Conflict. The container name "/postgres" is already in use by container "1ee6b28116f97a510e8e7991110822e9a2df1b07c3a2ac49b88c681c1e27c118". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run -e POSTGRES_PASSWORD=postgres -d postgres 
6e06a244fe5838ad3afc609fb638f204da3c817484aed8960ff1710d4e94a6b8
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres           
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres            
"docker run" requires at least 1 argument.
See 'docker run --help'.

Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres -d postgres
docker: Error response from daemon: Conflict. The container name "/postgres" is already in use by container "1ee6b28116f97a510e8e7991110822e9a2df1b07c3a2ac49b88c681c1e27c118". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker container ls                                                 
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker ps -a
CONTAINER ID   IMAGE            COMMAND                  CREATED       STATUS                      PORTS                      NAMES
756c2e4f8a45   mariadb:latest   "docker-entrypoint.s…"   2 weeks ago   Exited (255) 2 weeks ago    127.0.0.1:3306->3306/tcp   mariadb
1ee6b28116f9   postgres         "docker-entrypoint.s…"   3 weeks ago   Exited (0) 11 minutes ago                              postgres
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run postgres
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres -d postgres
docker: Error response from daemon: Conflict. The container name "/postgres" is already in use by container "1ee6b28116f97a510e8e7991110822e9a2df1b07c3a2ac49b88c681c1e27c118". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
seungkyoonham@seungkyoonhamui-MacBookPro ~ % docker run --name postgres -e POSTGRES_PASSWORD=postgres -d postgres
6040f56a818cfac0fdc7744b8fdf1b4910f36672c483603dda4d73e97476cea6
seungkyoonham@seungkyoonhamui-MacBookPro ~ %

 

후... 이미 잠깐의 삽질로 500자 다 채웟따리...

 

 위의 저 외계인 문자 삽질과정을 한마디로 요약하자면,

내는 'AWS Linux2'에서만 해본거지 맥북프로는 아모른직다.(종료된 컨테이너 다시 키는 방법 구글링구글링)

 그런고로 여기 CLI에서 컨테이너를 끄고키는 과정에서도 컨테이너를 그냥 날리고 다시 해버렸다가,

'어, 이러면 DB 저장해둔 내용물도 같이 하늘로 날아가겠는데?'

싶어서 계속 이것저것 두드려 보는 중이다.

 

 

 

----> 09월 29일 없데이트. 아예 DB 사용을 최소화하고 Spring Data JPA에서 관리하는 ORM 위주로 가기로 함.

이제 그냥 DB 컨테이너 날려도 되겠따!

 

...잠깐, 'restart'?

--->09/30

........Aㅏ;;

docker start postgres

 

어이없는, 붕어같은 기억력으로 30분을 날렸네.(당연히 다시 키는거면 '스타트'잖아;;)

이번차시 마무리하고 22일차에 내용 압축해서 작성한다;;

 

 

 

본 포스팅은 패스트캠퍼스 환급 챌린지 참여를 위해 작성되었습니다.

https://bit.ly/37BpXiC

 

패스트캠퍼스 [직장인 실무교육]

프로그래밍, 영상편집, UX/UI, 마케팅, 데이터 분석, 엑셀강의, The RED, 국비지원, 기업교육, 서비스 제공.

fastcampus.co.kr