본문 바로가기
Docker

Docker- wsl2에서 ubuntu:20.04 LTS 환경 system clock과 현재시각(timezone) 때문에 나타나는 에러 해결법

by 앵남(Andy) 2021. 12. 9.

글 개요 

docker을 활용하여 Ubuntu:20.04 환경에 python3.6을 설치하여, 셀레니움으로 데이터를 수집하여 aws의 s3에 자동으로 저장하는 개인 프로젝트를 진행하다가 나타난 에러을 해결한 방법을 공유하려고 합니다.

 

글 본문

E: Release file for http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 1h 41min 54s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 2h 8min 45s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease is not valid yet (invalid for another 1h 43min 10s). Updates for this repository will not be applied.

docker에서 환경을 구성중에 apt-get update가 되지않고 중단되는 현상이였습니다. 알고보니, 현재 시각과(timezone) 시스템 시각(system clock)이 일치하지 않아서 생기는 오류였습니다. 그래서 체크를 해보았습니다.

ubuntu:20.04 LTS
현재시각

현재시각과 우분투의 시각이 다르다는걸 알았습니다. 왜그런지 찾아보니까 system clock은 가상머신을 사용한 그 시점에서 멈춘다고 한다고 하네요.(제가 잘못해석한 것일 수 도 있습니다.ㅎㅎ)

참고자료

https://askubuntu.com/questions/1059217/getting-release-is-not-valid-yet-while-updating-ubuntu-docker-container

 

Getting 'Release is not valid yet' while updating ubuntu docker container

I am trying to update a ubuntu container with a dockerfile. RUN apt-get update -y But I am getting the below error. E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/

askubuntu.com

 

해결법

apt-get update을 해주기전에 아래명령어를 먼저 실행시켜주면 해결이 됩니다. 

RUN echo "Acquire::Check-Valid-Until \"false\";\nAcquire::Check-Date \"false\";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until
RUN apt-get update

파이썬 환경을 구축하려고 5시간넘게 사용한거 같네요.. 그래도 끝까지 포기하지않고 찾아서 해결하니 행복합니다.ㅎㅎ..

 

'Docker' 카테고리의 다른 글

컨테이너(Container)  (0) 2022.12.01
Docker - 모든 image와 container삭제하기  (0) 2021.12.09
Docker - 컨테이너(Container) 만들기  (0) 2021.11.11
Docker - container and image  (0) 2021.11.10
Docker 특징  (0) 2021.11.09

댓글