Closed Ettery closed 6 years ago
OK, I've solved this by installing the tzdata package prior to using it.
ENV TZ 'Africa/Johannesburg'
RUN echo $TZ > /etc/timezone && \
apt-get update && apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
It seems it was there in the earlier distro, but not the latest.
We are moving our .NET Core APIs from v1.1 to v2. With
microsoft/aspnetcore:1.1.2
I usedRUN echo "Africa/Johannesburg" > /etc/timezone
in the Dockerfile to set the timezone.Using an identical Dockerfile, but building on either
aspnetcore:2.0.5-stretch
oraspnetcore:2.0.5-jessie
as a base, the timezone does not change:How can I get this to work?
I tried
RUN timedatectl set-timezone Africa/Johannesburg
which is supposed to work in Debian, but it fails.