1일차에 배운 내용을 가지고 가벼운 콘테스트가 열렸다
하루 배우고...할 수 있을까... 싶긴 했지만
강사님이 예시로 올려준 파일들을 참고해서 비슷하게 한 번 구현해봤다!
어떤 걸 만들어볼까 하다가....
생각이 안나서 그냥 도시별 날씨 알림 도구를 만들기로 했다
결과를 먼저 보여주면 아래와 같다!!
우선 내가 만든 도구를 사용하기 위해서는 사전 준비가 필요하다...
1. 회원가입
Сurrent weather and forecast - OpenWeatherMap
Access current weather data for any location on Earth including over 200,000 cities! The data is frequently updated based on the global and local weather models, satellites, radars and a vast network of weather stations. how to obtain APIs (subscriptions w
openweathermap.org
위 사이트에 접속하여 회원가입을 하고,
이메일 인증까지 완료해줘야 한다.
2. API 구독(무료)
Weather API - OpenWeatherMap
Please, sign up to use our fast and easy-to-work weather APIs. As a start to use OpenWeather products, we recommend our One Call API 3.0. For more functionality, please consider our products, which are included in professional collections.
openweathermap.org
위 사이트에 접속해서 아래와 같이
subscribe를 누르고, Get API key를 눌러준다.
3. API KEY 복사
Members
Enter your email address and we will send you a link to reset your password.
home.openweathermap.org
위 링크에 아래와 같은 화면에서 본인의 키를 복사해둔다.
4. fork해서 로컬에서 clone
GitHub - jian1114/docker-pro-2308: 원티드와 함께하는 Docker 뽀개기
원티드와 함께하는 Docker 뽀개기. Contribute to jian1114/docker-pro-2308 development by creating an account on GitHub.
github.com
# 본인이 clone한 폴더 경로
cd /Users/jian/wanted_docker/docker-pro-2308/contest/jian1114
5. 이미지 빌드
# {} 안에는 본인의 docker hub ID로 수정
docker build --tag {your-docker-hub-namespace}/weather:latest .
6. 컨테이너 실행
# {} 안에는 본인의 docker hub ID로 수정
docker run -it {your-docker-hub-namespace}/weather:latest
7. API key 입력
3번에서 복사한 API Key를 입력한다
8. 도시 입력
본인이 살고 있는 도시 이름을 영어로 입력한다
(ex. Suwon, Seoul, Yongin, ...)
그럼 이렇게 내가 살고 있는 도시의 날씨와 온도가 출력되는 것을 볼 수 있다!!
비록... 번거롭고... 허접하지만...
Docker를 사용해봤다는 것만으로 만족한다!!