Skip to content

SetUp timezone #33

@zakrush

Description

@zakrush

Into your Dockerfile you set:

ENV SET_CONTAINER_TIMEZONE False
ENV CONTAINER_TIMEZONE Etc/UTC

So, I was trying to change this ENV into my docker-compose.yaml:

    environment:
      - SET_CONTAINER_TIMEZONE=True
      - CONTAINER_TIMEZONE Europe/Moscow

But it didn't work. I get alerts as Etc/UTC Timezone.
I think this is becouse you don't have a sctipt that set up timezone into you Dockerfile.

#!/bin/bash
if [ "$SET_CONTAINER_TIMEZONE" = "True" ]; then
    cp /usr/share/zoneinfo/${CONTAINER_TIMEZONE} /etc/localtime && \
	echo "${CONTAINER_TIMEZONE}" >  /etc/timezone && \
fi

My logs when Docker up:

elastalert_1     | 07:46:00.791Z  INFO elastalert-server: ProcessController:  Creating index
elastalert_1     | 07:46:01.466Z  INFO elastalert-server:
elastalert_1     |     ProcessController:  Elastic Version:6

My time is 10.46

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions