컴공생의 발자취

[내일배움캠프 54일차 TIL] Docker 설치 (feat. Mac) 본문

🤝 활동/내배캠TIL

[내일배움캠프 54일차 TIL] Docker 설치 (feat. Mac)

MNY 2024. 7. 4. 00:17
728x90
반응형
2024.07.03.(수)
오늘의 진도 : 개인과제 테스트 코드 진행 중...

챌린지 팀 포기!
오늘의 학습, 개인과제, 코드카타, 오늘의 회고 이렇게 4개의 큰 틀로 나누어 정리할 것이다.

 

💡 오늘의 학습 키워드

- Docker 1주차 -
Mac Docker 설치
터미널 Docker 설치 warning
Docker Desktop Error


 

Mac Docker 설치

  • https://brew.sh/ko
    • 커맨드 복사
    • 터미널에서 복사한 커맨드 실행
    • 설치 후 brew doctor 실행
# 사전에 homebrew 설치 필수


# docker for mac설치
brew install docker docker-compose

# docker version 확인
docker --version

# docker compose version 확인
docker-compose --version

 

Install Docker Desktop on Mac

Install Docker for Mac to get started. This guide covers system requirements, where to download, and instructions on how to install and update.

docs.docker.com

 

터미널 Docker 설치 warning

  • 문제 상황 : Homebrew가 설치된 경로인 /opt/homebrew/bin이 현재 사용자의 PATH에 포함되어 있지 않아 발생
Warning: /opt/homebrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
  • 해결 방법 : PATH에 Homebrew 경로 추가
// 경로 추가할 파일 열기
nano ~/.zshrc

// 파일에 아래의 코드 추가
export PATH="/opt/homebrew/bin:$PATH"

// 저장 및 종료 : 'Ctrl + W' 'Y'

// 새로고침
source ~/.zshrc

// 확인
echo $PATH

 

Docker Desktop  설치 Error

  • 문제 상황 : 내 컴퓨터와 사양이 맞지 않음
We are sorry, but your hardware is incompatible with Docker Desktop.

Docker requires a processor with virtualization capabilities and hypervisor support.

To learn more about this issue see:

https://docs.docker.com/desktop/mac/troubleshoot/#incompatible-cpu-detected
  • 해결 방법 : 내 컴퓨터는 apple 칩인데 intel 칩을 다운 받음.. 내 컴퓨터와 맞는 걸로 다시 다운로드.

 


개인과제

현재 회원가입 dto의 유효성 검사로 테스트 코드를 진행했으며, controller의 테스트 코드를 작성하던 중 @Autowired가 아래와 같은 에러가 발생했었는데 이게 무시해도 되는 것이라고 들었다.

Autowired members must be defined in valid Spring bean (@Component|@Service|...)

 

이렇게 Syntax로 하면 에러가 보이지 않는다. 

 

그리고 다른 방법은 아래의 어노테이션을 붙여주는 것이다.

 

* 2024.07.04.(목) 업데이트 내용 

근데 @WebMvcTest 어노테이션은 @SpringBootTest랑 겹쳐서 둘 중 하나만 써줘야 함

@SpringBootTest
@AutoConfigureMockMvc

 

해당 부분이 아래의 문제 상황을 야기했는 줄 알았으나 아니었다. 일단은 수정 후 계속 진행 중에 있다.!

 

  • 문제 상황 : JpaAuitingHandler 관련 에러 발생
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaAuditingHandler': Cannot resolve reference to bean 'jpaMappingContext' while setting constructor argument
  • 해결 방법 : Application에 추가된 @EnableJpaAuditing이 문제였으며 이 부분을 삭제하고 JpaConfig를 따로 만들면 된다.
@Configuration // 아래 설정을 등록하여 활성화 합니다.
@EnableJpaAuditing // 시간 자동 변경이 가능하도록 합니다.
public class JpaConfig {
}

코드 카타

* 프로그래머스로 진행

 

  • 알고리즘
    • 푸드 파이트 대회
  • SQL
    • 자동차 대여 기록에서 장기/단기 대여 구분하기
 

[MySQL] DATEDIFF, TIMESTAMPDIFF 함수를 통한 날짜 차이 계산하기

1. 서론 - MySQL 에서 날짜 차이를 구하기 위해 DATEDIFF, TIMESTAMPDIFF 함수를 사용합니다. - 간단하게 일(day) 차이를 구할 때는 DATEDIFF 함수를 사용. - 이외에 연(year), 월(month), 시간(hour), 초(second) 등을 지

dev-jwblog.tistory.com

 

 


오늘의 회고

  • 12시간 중 얼마나 몰입했는가?

오전 6시부터 했는데 오늘은 하고자 했던 진도도 모두 나가지 못했고

제대로 집중한 시간이 거의 없는 것 같다.

 

  • 오늘의 생각

내일 오전 중으로 테스트 코드는 무조건 끝내야 한다.

 

  • 내일 학습할 것은 무엇인지

개인과제 진행, Docker 강의 2주차 듣기, 기술면접 키워드로 답변 정리, 코드카타 1문제 이상 풀기,..

728x90
반응형