diff --git a/INSTALL.md b/INSTALL.md index 683e8ab51..e850056e3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,11 +16,11 @@ See [instructions](./docker/README.md) Note the required `-tags rethinkdb` build option. -You may also optionally define `main.buildstamp` for the server by adding a build option +You may also optionally define `main.buildstamp` for the server by adding a build option, for instance, with a timestamp: ``` --X main.buildstamp=`date -u '+%Y%m%dT%H:%M:%SZ'` +-ldflags "-X main.buildstamp=`date -u '+%Y%m%dT%H:%M:%SZ'`" ``` -This build timestamp will be sent by the server to the clients. +The value of `buildstamp` will be sent by the server to the clients. - Download javascript client for testing: - https://github.com/tinode/example-react-js/archive/master.zip diff --git a/docker/tinode-server/Dockerfile b/docker/tinode-server/Dockerfile index c4585b8e9..7194cc2eb 100644 --- a/docker/tinode-server/Dockerfile +++ b/docker/tinode-server/Dockerfile @@ -21,7 +21,8 @@ ENV TARGET_DB=$TARGET_DB # Build the binary. RUN go get -tags $TARGET_DB github.com/tinode/chat/server \ - && go install -tags $TARGET_DB github.com/tinode/chat/server + && go install -tags $TARGET_DB -ldflags "-X main.buildstamp=${TARGET_DB}-`date -u '+%Y%m%dT%H:%M:%SZ'`" \ + github.com/tinode/chat/server # Download the demo app and the js bindings RUN git clone --depth 1 https://github.com/tinode/example-react-js.git