docker-jmeter icon indicating copy to clipboard operation
docker-jmeter copied to clipboard

timezone support added

Open gabrielke opened this issue 4 years ago • 3 comments

Added timezone support

gabrielke avatar Apr 23 '20 20:04 gabrielke

Step 10/12 : COPY entrypoint.sh / COPY failed: stat /var/lib/docker/tmp/docker-builder422719991/entrypoint.sh: no such file or directory

getting this error need help.

ishanhanda93 avatar May 15 '20 08:05 ishanhanda93

Hi, hope your addition solved this. Is always tricky issue getting configurable TZ. 2 minor comments:

  • add your changes to the single RUN, reason is it makes the Docker Image smaller (than separate RUN statements)
  • ENV TZ=$TZ is not required as it is already set via ARG (with default "Europe/Amsterdam", seee also ARG JMETER_VERSION="5.1.1", same principle.

I have little time. Below how I should think the Dockerfile should look like. Can you test?

# inspired by https://github.com/hauptmedia/docker-jmeter  and
# https://github.com/hhcordero/docker-jmeter-server/blob/master/Dockerfile
FROM alpine:3.10

MAINTAINER Just van den Broecke<[email protected]>

ARG JMETER_VERSION="5.1.1"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV	JMETER_BIN	${JMETER_HOME}/bin
ENV	JMETER_DOWNLOAD_URL  https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz

# Install extra packages
# See https://github.com/gliderlabs/docker-alpine/issues/136#issuecomment-272703023
ARG TZ="Europe/Amsterdam"
RUN apk update \
	&& apk upgrade \
	&& apk add ca-certificates \
	&& update-ca-certificates \
	&& apk add --update openjdk8-jre tzdata curl unzip bash \
	&& apk add --no-cache nss \
	&& cp /usr/share/zoneinfo/${TZ} /etc/localtime \
	&& echo ${TZ} > /etc/timezone \
	&& rm -rf /var/cache/apk/* \
	&& mkdir -p /tmp/dependencies  \
	&& curl -L --silent ${JMETER_DOWNLOAD_URL} >  /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz  \
	&& mkdir -p /opt  \
	&& tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt  \
	&& rm -rf /tmp/dependencies

# TODO: plugins (later)
# && unzip -oq "/tmp/dependencies/JMeterPlugins-*.zip" -d $JMETER_HOME

# Set global PATH such that "jmeter" command is found
ENV PATH $PATH:$JMETER_BIN

# Entrypoint has same signature as "jmeter" command
COPY entrypoint.sh /

WORKDIR	${JMETER_HOME}

ENTRYPOINT ["/entrypoint.sh"]

Hello @justb4 i've built and tested this, it works ! I can't edit this PR.

vitoo avatar Jun 11 '20 19:06 vitoo

did the requested changes. tested with amsterdam and moscow timezones, works.

gabrielke avatar Jun 20 '20 14:06 gabrielke