This is a micro-tip. If you have a Debian/Ubuntu container that is set to the wrong timezone and doesn’t have the normal tools for setting that timezone, here’s how to do it. Add the following lines to your Dockerfile:

# Set the timezone.
RUN sudo echo "America/New_York" > /etc/timezone
RUN sudo dpkg-reconfigure -f noninteractive tzdata

This particular example sets the timezone to Eastern Standard Time. Here’s the full list of locales.