Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpine Docker images no longer have tzdata package in 3.0 #1366

Closed
mthalman opened this issue Oct 3, 2019 · 6 comments
Closed

Alpine Docker images no longer have tzdata package in 3.0 #1366

mthalman opened this issue Oct 3, 2019 · 6 comments

Comments

@mthalman
Copy link
Member

mthalman commented Oct 3, 2019

Alpine Docker images no longer have tzdata package in 3.0

Beginning with the 3.0 release, the tzdata package has been removed from all Alpine Docker images.

Details

This package was removed because it wasn't required for the main set of scenarios and to have consistency between the runtime-deps images across all Linux distros. This package is still installed in the 2.x images for Alpine so this will be something to be aware of when migrating from 2.x to 3.0.

You may be impacted by this if you use any of the Alpine images for 3.0 and your code has a dependency on the tzdata package, such as using the System.TimeZoneInfo API. In that case, you'll need to update your Dockerfile to explicitly install the package:

RUN apk add --no-cache tzdata
@seroche
Copy link

seroche commented Oct 4, 2019

We deployed our first .net core microservice to our UAT environment 3 days ago. It took me few hours to find out that tzdata was missing from the docker package! @mj1856 you should probably document this. Anyone using TZConvert within an Alpine docker will have to include this package.

@mattjohnsonpint
Copy link

@seroche - Added here. Thanks.

@tushi0407
Copy link

tushi0407 commented Mar 20, 2020

Hello Sorry for commenting on closed post.
But actually i am facing the same issue here. I am using ubuntu based dot net core image 3.0 .
My aim is very simple, i just need to find out current CST time.
I have installed the tzdata package but still getting ResponseMessage: "System.TimeZoneNotFoundException: Exception of
type 'System.TimeZoneNotFoundException' was thrown.↵ at TimeZoneConverter.TZConvert.GetTimeZoneInfo(String windowsOrIanaTimeZoneId)↵

Here is my docker file :
`FROM mcr.microsoft.com/dotnet/core/sdk:3.0-bionic AS build-env

WORKDIR /app
ADD UbuntuScript.sh /UbuntuScript.sh
RUN /UbuntuScript.sh

Copy everything else and build

COPY . ./
RUN dotnet publish xyz -c Release -o out

Build runtime image

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
WORKDIR /app

#COPY --from=build-env /app/out .
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "xyz.dll"]`

Ubuntu Script file :

set noninteractive installation

export DEBIAN_FRONTEND=noninteractive
#install tzdata package
apt-get update
apt-get install tzdata -y

set your timezone

ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata

dot net core code where i am using
TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, TimeZoneConverter.TZConvert.GetTimeZoneInfo("Central Standard Time"));
@mj1856 @mthalman please help, i m sure i am missing some small thing.

@mthalman
Copy link
Member Author

@tushi0407 - Have you verified tzdata is installed in the image where your app is contained? From what you pasted, it looks like you're installing the package into your SDK image rather than your runtime image.

@tushi0407
Copy link

tushi0407 commented Mar 20, 2020

Thanks for your reply @mthalman , Actually I am very new to docker. So could you please help me how I can check that? What needs to be change on docker file?

@tushi0407
Copy link

Thanks @mthalman ..it is resolved now.I was doing the same mistake . I have changed the place where i was installing tzdata.Now i am installing it under run time image.I have placed ADD UbuntuScript.sh /UbuntuScript.sh RUN /UbuntuScript.sh just after FROM ../dotnet/core/aspnet:3.1-bionic WORKDIR /app. It is working now.

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants