Zookeeper 3.4.9 : ant rpm target failing - ant

I am trying to create zookeeper 3.4.9 rpm.
I have downloaded the 3.4.9 release from git and trying to run the ant build.
However the ant build is failing with the below error:
..
..
..
[rpm] -rwxr-xr-x 0/0 3817 2016-11-10 15:45 zookeeper-3.4.9/src/packages/update-zookeeper-env.sh
[rpm] -rwxr-xr-x 0/0 1771 2016-11-10 15:45 zookeeper-3.4.9/src/recipes/lock/src/c/tests/zkServer.sh
[rpm] -rwxr-xr-x 0/0 1771 2016-11-10 15:45 zookeeper-3.4.9/src/recipes/queue/src/c/tests/zkServer.sh
[rpm] Executing(%build): /bin/bash -e /var/tmp/rpm-tmp.DnyC6m
[rpm] Executing(%install): /bin/bash -e /var/tmp/rpm-tmp.h96FLJ
[rpm] + STATUS=0
[rpm] + '[' 0 -ne 0 ']'
[rpm] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
[rpm] + exit 0
[rpm] + umask 022
[rpm] + cd /tmp/zookeeper_package_build_root/BUILD
[rpm] + cd zookeeper-3.4.9
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/bin
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/include
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/lib
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/lib64
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/libexec
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/var/log/zookeeper
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/etc/zookeeper
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/man
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/var/run/zookeeper
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/sbin
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/usr/share/zookeeper
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/var/lib/zookeeper
[rpm] + mkdir -p /tmp/zookeeper_package_build_root/BUILD/etc/init.d
[rpm] + cp /tmp/zookeeper_package_build_root/BUILD/zookeeper-3.4.9/src/packages/rpm/init.d/zookeeper /tmp/zookeeper_package_build_root/BUILD/etc/init.d/zookeep
[rpm] + cp /tmp/zookeeper_package_build_root/BUILD/zookeeper-3.4.9/src/packages/update-zookeeper-env.sh /tmp/zookeeper_package_build_root/BUILD/zookeeper-3.4.9
[rpm] + chmod 0755 /tmp/zookeeper_package_build_root/BUILD/zookeeper-3.4.9/sbin/update-zookeeper-env.sh /tmp/zookeeper_package_build_root/BUILD/zookeeper-3.4.9build_root/BUILD/zookeeper-3.4.9/sbin/zkServer.sh
[rpm] + chmod 0755 /tmp/zookeeper_package_build_root/BUILD/etc/init.d/zookeeper
[rpm] + exit 0
[rpm] + umask 022
[rpm] + cd /tmp/zookeeper_package_build_root/BUILD
[rpm] + '[' /tmp/zookeeper_package_build_root/BUILD '!=' / ']'
[rpm] + rm -rf /tmp/zookeeper_package_build_root/BUILD
[rpm]
[rpm]
[rpm] RPM build errors:
[rpm] ++ dirname /tmp/zookeeper_package_build_root/BUILD
[rpm] + mkdir -p /tmp/zookeeper_package_build_root
[rpm] + mkdir /tmp/zookeeper_package_build_root/BUILD
[rpm] + cd zookeeper-3.4.9
[rpm] /var/tmp/rpm-tmp.h96FLJ: line 32: cd: zookeeper-3.4.9: No such file or directory
[rpm] error: Bad exit status from /var/tmp/rpm-tmp.h96FLJ (%install)
[rpm] Bad exit status from /var/tmp/rpm-tmp.h96FLJ (%install)
I tried :
1) ant rpm -Dskip.contrib=1
2) ant rpm
but both are failing with same error.

Related

dial tcp: lookup goproxy.cn: i/o timeout when build my own Docker image

I am building a Docker image of my own with VPN connected
I consistently encounter the error :dial tcp: lookup goproxy.cn: i/o timeout.
I searched for the answer , seems like I need a proxy in order to access the github and download go pakage, which I have added 'PROXY' env in my Dockerfile , but still I consistently encounter this 'dial tcp: lookup goproxy.cn: i/o timeout ' error
go: github.com/PuerkitoBio/goquery#v1.8.0: Get "https://goproxy.cn/github.com/%21puerkito%21bio/goquery/#v/v1.8.0.mod": dial tcp: lookup goproxy.cn: i/o timeout
Here are my Dockerfile and Make file
Docker file :
ARG BASE_IMAGE_ARCH="amd64"
FROM ${BASE_IMAGE_ARCH}/golang:buster AS build
# blocking github workaround
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
ENV GOSUMDB="sum.golang.google.cn"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -q && \
apt-get install -y -qq build-essential devscripts dh-make dh-systemd && \
mkdir -p /build/debian && \
mkdir /pkg/
ADD . /src
CMD ["/src/packaging/debian/build.sh"]
Here is my Makefile , I am 'make debian':
APP := miniflux
DOCKER_IMAGE := miniflux/miniflux
VERSION := $(shell git describe --tags --abbrev=0)
COMMIT := $(shell git rev-parse --short HEAD)
BUILD_DATE := `date +%FT%T%z`
LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app/version.Commit=$(COMMIT)' -X 'miniflux.app/version.BuildDate=$(BUILD_DATE)'"
PKG_LIST := $(shell go list ./... | grep -v /vendor/)
DB_URL := postgres://postgres:postgres#localhost/miniflux_test?sslmode=disable
DEB_IMG_ARCH := amd64
export PGPASSWORD := postgres
.PHONY: \
miniflux \
linux-amd64 \
linux-arm64 \
linux-armv7 \
linux-armv6 \
linux-armv5 \
linux-x86 \
darwin-amd64 \
darwin-arm64 \
freebsd-amd64 \
freebsd-x86 \
openbsd-amd64 \
openbsd-x86 \
netbsd-x86 \
netbsd-amd64 \
windows-amd64 \
windows-x86 \
build \
run \
clean \
test \
lint \
integration-test \
clean-integration-test \
docker-image \
docker-image-distroless \
docker-images \
rpm \
debian \
debian-packages
miniflux:
# go build -buildmode=pie -ldflags=$(LD_FLAGS) -o $(APP) main.go
linux-amd64:
# GOOS=linux GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-amd64 main.go
linux-arm64:
# GOOS=linux GOARCH=arm64 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-arm64 main.go
linux-armv7:
# GOOS=linux GOARCH=arm GOARM=7 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv7 main.go
linux-armv6:
# GOOS=linux GOARCH=arm GOARM=6 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv6 main.go
linux-armv5:
# GOOS=linux GOARCH=arm GOARM=5 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-armv5 main.go
darwin-amd64:
# GOOS=darwin GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-darwin-amd64 main.go
darwin-arm64:
# GOOS=darwin GOARCH=arm64 go build -ldflags=$(LD_FLAGS) -o $(APP)-darwin-arm64 main.go
freebsd-amd64:
# GOOS=freebsd GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-freebsd-amd64 main.go
openbsd-amd64:
# GOOS=openbsd GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-openbsd-amd64 main.go
windows-amd64:
# GOOS=windows GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-windows-amd64 main.go
build: linux-amd64 linux-arm64 linux-armv7 linux-armv6 linux-armv5 darwin-amd64 darwin-arm64 freebsd-amd64 openbsd-amd64 windows-amd64
# NOTE: unsupported targets
netbsd-amd64:
# GOOS=netbsd GOARCH=amd64 go build -ldflags=$(LD_FLAGS) -o $(APP)-netbsd-amd64 main.go
linux-x86:
# GOOS=linux GOARCH=386 go build -ldflags=$(LD_FLAGS) -o $(APP)-linux-x86 main.go
freebsd-x86:
# GOOS=freebsd GOARCH=386 go build -ldflags=$(LD_FLAGS) -o $(APP)-freebsd-x86 main.go
netbsd-x86:
# GOOS=netbsd GOARCH=386 go build -ldflags=$(LD_FLAGS) -o $(APP)-netbsd-x86 main.go
openbsd-x86:
# GOOS=openbsd GOARCH=386 go build -ldflags=$(LD_FLAGS) -o $(APP)-freebsd-x86 main.go
windows-x86:
# GOOS=windows GOARCH=386 go build -ldflags=$(LD_FLAGS) -o $(APP)-windows-x86 main.go
run:
# LOG_DATE_TIME=1 go run main.go -debug
clean:
# rm -f $(APP)-* $(APP) $(APP)*.rpm $(APP)*.deb
test:
go test -cover -race -count=1 ./...
lint:
golint -set_exit_status ${PKG_LIST}
integration-test:
psql -U postgres -c 'drop database if exists miniflux_test;'
psql -U postgres -c 'create database miniflux_test;'
go build -o miniflux-test main.go
DATABASE_URL=$(DB_URL) \
ADMIN_USERNAME=admin \
ADMIN_PASSWORD=test123 \
CREATE_ADMIN=1 \
RUN_MIGRATIONS=1 \
DEBUG=1 \
./miniflux-test >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid"
while ! nc -z localhost 8080; do sleep 1; done
go test -v -tags=integration -count=1 miniflux.app/tests
clean-integration-test:
# kill -9 `cat /tmp/miniflux.pid`
# rm -f /tmp/miniflux.pid /tmp/miniflux.log
# rm miniflux-test
# psql -U postgres -c 'drop database if exists miniflux_test;'
docker-image:
docker build -t $(DOCKER_IMAGE):$(VERSION) -f packaging/docker/alpine/Dockerfile .
docker-image-distroless:
docker build -t $(DOCKER_IMAGE):$(VERSION) -f packaging/docker/distroless/Dockerfile .
docker-images:
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \
--file packaging/docker/alpine/Dockerfile \
--tag $(DOCKER_IMAGE):$(VERSION) \
--push .
debian:
# docker build \
--build-arg BASE_IMAGE_ARCH=$(DEB_IMG_ARCH) \
-t $(DEB_IMG_ARCH)/miniflux-deb-builder \
-f packaging/debian/Dockerfile \
--network=host \
.
# docker run --rm \
-v ${PWD}:/pkg $(DEB_IMG_ARCH)/miniflux-deb-builder

Error: docker buildx on x86_64 for building multiarch--x86_64, arm64

I just make multarch images by using buildx
When running docker buildx build --platform linux/amd64,linux/arm64 -t maskertim/zookeeper-demo .
Error Message
The Error as following:
------
> [linux/arm64 3/5] RUN curl "https://archive.apache.org/dist/kafka/2.8.0/kafka_2.13-2.8.0.tgz" -o /tmp/kafka/kafka.tgz && mkdir /kafka && cd /kafka && tar -xzvf /tmp/kafka/kafka.tgz --strip 1:
#8 0.915 % Total % Received % Xferd Average Speed Time Time Time Current
#8 0.916 Dload Upload Total Spent Left Speed
100 68.0M 100 68.0M 0 0 936k 0 0:01:14 0:01:14 --:--:-- 3475k
#8 75.45 tar: Child returned status 1
#8 75.45 tar: Error is not recoverable: exiting now
------
dockerfile:9
--------------------
8 |
9 | >>> RUN curl "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \
10 | >>> -o /tmp/kafka/kafka.tgz && \
11 | >>> mkdir /kafka && cd /kafka && \
12 | >>> tar -xzvf /tmp/kafka/kafka.tgz --strip 1
13 |
--------------------
error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c curl \"https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz\" \t-o /tmp/kafka/kafka.tgz && \tmkdir /kafka && cd /kafka && \ttar -xzvf /tmp/kafka/kafka.tgz --strip 1" did not complete successfully: exit code: 2
Dockerfile
And this is my dockerfile:
FROM openjdk:11.0.12-jre-buster
ENV KAFKA_VERSION 2.8.0
ENV SCALA_VERSION 2.13
RUN mkdir /tmp/kafka && \
apt-get update && \
apt-get install -y curl
RUN curl "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \
-o /tmp/kafka/kafka.tgz && \
mkdir /kafka && cd /kafka && \
tar -xzvf /tmp/kafka/kafka.tgz --strip 1
COPY start-zookeeper.sh /usr/bin
RUN chmod +x /usr/bin/start-zookeeper.sh
CMD ["start-zookeeper.sh"]
What happens? I have no idea why to occur this error and no way to solve it.
Unzip it first:
gzip -d /tmp/kafka/kafka.tgz
And after that untar it with:
tar xpf /tmp/kafka/kafka.tar
I had the same problem and discovered https://stackoverflow.com/a/71143883
Running
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
allowed me to keep the decompression step in the tar command
I think the problem is related to tar or more specific one of its child processes is failing to untar or unzip because of a missing dependency, which seems not to be present in the qemu_emulator that buildx uses.
I ended up using the ADD command in the dockerfile instead of RUN tar, which has that functionality built in.

can't create '/etc/default/solr.in.sh': No such file or directory

I am trying to deploy my dockerfile on Redhat UGI image and i have walked in to some errors. However when i build the dockerfile i get the can't create '/etc/default/solr.in.sh': No such file or directory.
ubi8/ubi8-minimal
FROM alpine:edge as BUILD
FROM python:alpine
LABEL maintainer="Project Ranger team <mbyousaf#deloitte.co.uk>"
LABEL repository="https://github.com/docker-solr/docker-solr"
ARG SOLR_VERSION="8.6.2"
ARG SOLR_SHA512="0a43401ecf7946b2724da2d43896cd505386a8f9b07ddc60256cb586873e7e58610d2c34b1cf797323bf06c7613b109527a15105dc2a11be6f866531a1f2cef6"
ARG SOLR_KEYS="E58A6F4D5B2B48AC66D5E53BD4F181881A42F9E6"
# If specified, this will override SOLR_DOWNLOAD_SERVER and all ASF mirrors. Typically used downstream for custom builds
ARG SOLR_DOWNLOAD_URL
# Override the solr download location with e.g.:
# docker build -t mine --build-arg SOLR_DOWNLOAD_SERVER=http://www-eu.apache.org/dist/lucene/solr .
ARG SOLR_DOWNLOAD_SERVER
RUN set -ex; \
apk update; \
apk add -f acl dirmngr gnupg lsof procps wget ; \
rm -rf /var/lib/apt/lists/*; \
cd /usr/local/bin; wget -nv https://github.com/apangin/jattach/releases/download/v1.5/jattach; chmod 755 jattach; \
echo >jattach.sha512 "d8eedbb3e192a8596c08efedff99b9acf1075331e1747107c07cdb1718db2abe259ef168109e46bd4cf80d47d43028ff469f95e6ddcbdda4d7ffa73a20e852f9 jattach"; \
sha512sum -c jattach.sha512; rm jattach.sha512
ENV SOLR_USER="solr" \
SOLR_UID="8983" \
SOLR_GROUP="solr" \
SOLR_GID="8983" \
SOLR_CLOSER_URL="http://www.apache.org/dyn/closer.lua?filename=lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz&action=download" \
SOLR_DIST_URL="https://www.apache.org/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz" \
SOLR_ARCHIVE_URL="https://archive.apache.org/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz" \
PATH="/opt/solr/bin:/opt/docker-solr/scripts:$PATH" \
SOLR_INCLUDE=/etc/default/solr.in.sh \
SOLR_HOME=/var/solr/data \
SOLR_PID_DIR=/var/solr \
SOLR_LOGS_DIR=/var/solr/logs \
LOG4J_PROPS=/var/solr/log4j2.xml
RUN set -ex; \
addgroup -S --gid "$SOLR_GID" "$SOLR_GROUP"; \
adduser -S --uid "$SOLR_UID" -S "$SOLR_GID" "$SOLR_USER"
RUN set -ex; \
export GNUPGHOME="/tmp/gnupg_home"; \
mkdir -p "$GNUPGHOME"; \
chmod 700 "$GNUPGHOME"; \
echo "disable-ipv6" >> "$GNUPGHOME/dirmngr.conf"; \
for key in $SOLR_KEYS; do \
found=''; \
for server in \
ha.pool.sks-keyservers.net \
hkp://keyserver.ubuntu.com:80 \
hkp://p80.pool.sks-keyservers.net:80 \
pgp.mit.edu \
; do \
echo " trying $server for $key"; \
gpg --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
gpg --batch --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$key" && found=yes && break; \
done; \
test -z "$found" && echo >&2 "error: failed to fetch $key from several disparate servers -- network issues?" && exit 1; \
done; \
exit 0
RUN set -ex; \
export GNUPGHOME="/tmp/gnupg_home"; \
MAX_REDIRECTS=1; \
if [ -n "$SOLR_DOWNLOAD_URL" ]; then \
# If a custom URL is defined, we download from non-ASF mirror URL and allow more redirects and skip GPG step
# This takes effect only if the SOLR_DOWNLOAD_URL build-arg is specified, typically in downstream Dockerfiles
MAX_REDIRECTS=4; \
SKIP_GPG_CHECK=true; \
elif [ -n "$SOLR_DOWNLOAD_SERVER" ]; then \
SOLR_DOWNLOAD_URL="$SOLR_DOWNLOAD_SERVER/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"; \
fi; \
for url in $SOLR_DOWNLOAD_URL $SOLR_CLOSER_URL $SOLR_DIST_URL $SOLR_ARCHIVE_URL; do \
if [ -f "/opt/solr-$SOLR_VERSION.tgz" ]; then break; fi; \
echo "downloading $url"; \
if wget -t 10 --max-redirect $MAX_REDIRECTS --retry-connrefused -nv "$url" -O "/opt/solr-$SOLR_VERSION.tgz"; then break; else rm -f "/opt/solr-$SOLR_VERSION.tgz"; fi; \
done; \
if [ ! -f "/opt/solr-$SOLR_VERSION.tgz" ]; then echo "failed all download attempts for solr-$SOLR_VERSION.tgz"; exit 1; fi; \
if [ -z "$SKIP_GPG_CHECK" ]; then \
echo "downloading $SOLR_ARCHIVE_URL.asc"; \
wget -nv "$SOLR_ARCHIVE_URL.asc" -O "/opt/solr-$SOLR_VERSION.tgz.asc"; \
echo "$SOLR_SHA512 */opt/solr-$SOLR_VERSION.tgz" | sha512sum -c -; \
(>&2 ls -l "/opt/solr-$SOLR_VERSION.tgz" "/opt/solr-$SOLR_VERSION.tgz.asc"); \
gpg --batch --verify "/opt/solr-$SOLR_VERSION.tgz.asc" "/opt/solr-$SOLR_VERSION.tgz"; \
else \
echo "Skipping GPG validation due to non-Apache build"; \
fi; \
tar -C /opt --extract --file "/opt/solr-$SOLR_VERSION.tgz"; \
(cd /opt; ln -s "solr-$SOLR_VERSION" solr); \
rm "/opt/solr-$SOLR_VERSION.tgz"*; \
rm -Rf /opt/solr/docs/ /opt/solr/dist/{solr-core-$SOLR_VERSION.jar,solr-solrj-$SOLR_VERSION.jar,solrj-lib,solr-test-framework-$SOLR_VERSION.jar,test-framework}; \
mkdir -p /opt/solr/server/solr/lib /docker-entrypoint-initdb.d /opt/docker-solr; \
chown -R 0:0 "/opt/solr-$SOLR_VERSION"; \
find "/opt/solr-$SOLR_VERSION" -type d -print0 | xargs -0 chmod 0755; \
find "/opt/solr-$SOLR_VERSION" -type f -print0 | xargs -0 chmod 0644; \
chmod -R 0755 "/opt/solr-$SOLR_VERSION/bin" "/opt/solr-$SOLR_VERSION/contrib/prometheus-exporter/bin/solr-exporter" /opt/solr-$SOLR_VERSION/server/scripts/cloud-scripts; \
cp /opt/solr/bin/solr.in.sh /etc/default/solr.in.sh; \
mv /opt/solr/bin/solr.in.sh /opt/solr/bin/solr.in.sh.orig; \
mv /opt/solr/bin/solr.in.cmd /opt/solr/bin/solr.in.cmd.orig; \
chown root:0 /etc/default/solr.in.sh; \
chmod 0664 /etc/default/solr.in.sh; \
mkdir -p /var/solr/data /var/solr/logs; \
(cd /opt/solr/server/solr; cp solr.xml zoo.cfg /var/solr/data/); \
cp /opt/solr/server/resources/log4j2.xml /var/solr/log4j2.xml; \
find /var/solr -type d -print0 | xargs -0 chmod 0770; \
find /var/solr -type f -print0 | xargs -0 chmod 0660; \
sed -i -e "s/\"\$(whoami)\" == \"root\"/\$(id -u) == 0/" /opt/solr/bin/solr; \
sed -i -e 's/lsof -PniTCP:/lsof -t -PniTCP:/' /opt/solr/bin/solr; \
chown -R "0:0" /opt/solr-$SOLR_VERSION /docker-entrypoint-initdb.d /opt/docker-solr; \
chown -R "$SOLR_USER:0" /var/solr; \
{ command -v gpgconf; gpgconf --kill all || :; }; \
rm -r "$GNUPGHOME"
COPY --chown=0:0 scripts /opt/docker-solr/scripts
RUN chmod -R +x /opt/docker-solr/scripts/*
VOLUME /var/solr
EXPOSE 8983
WORKDIR /opt/solr
USER $SOLR_USER
RUN echo $PATH
RUN ls -ltr /opt/docker-solr/scripts
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["solr-foreground"]
Below here is the error log that I am getting after building the docker file. What else could i add or any solutions to overcome the error that i keep getting?
/opt/solr-8.6.2.tgz: OK
+ ls -l /opt/solr-8.6.2.tgz /opt/solr-8.6.2.tgz.asc
-rw-r--r-- 1 root root 195624713 Aug 26 11:53 /opt/solr-8.6.2.tgz
-rw-r--r-- 1 root root 833 Aug 26 11:53 /opt/solr-8.6.2.tgz.asc
+ gpg --batch --verify /opt/solr-8.6.2.tgz.asc /opt/solr-8.6.2.tgz
gpg: Signature made Wed Aug 26 09:04:22 2020 UTC
gpg: using RSA key E58A6F4D5B2B48AC66D5E53BD4F181881A42F9E6
gpg: Good signature from "Ignacio Vera (CODE SIGNING KEY) <ivera#apache.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: E58A 6F4D 5B2B 48AC 66D5 E53B D4F1 8188 1A42 F9E6
+ tar -C /opt --extract --file /opt/solr-8.6.2.tgz
+ cd /opt
+ ln -s solr-8.6.2 solr
+ rm /opt/solr-8.6.2.tgz /opt/solr-8.6.2.tgz.asc
+ rm -Rf /opt/solr/docs/ '/opt/solr/dist/{solr-core-8.6.2.jar,solr-solrj-8.6.2.jar,solrj-lib,solr-test-framework-8.6.2.jar,test-framework}'
+ mkdir -p /opt/solr/server/solr/lib /docker-entrypoint-initdb.d /opt/docker-solr
+ chown -R 0:0 /opt/solr-8.6.2
+ find /opt/solr-8.6.2 -type d -print0
+ xargs -0 chmod 0755
+ find /opt/solr-8.6.2 -type f -print0
+ xargs -0 chmod 0644
+ chmod -R 0755 /opt/solr-8.6.2/bin /opt/solr-8.6.2/contrib/prometheus-exporter/bin/solr-exporter /opt/solr-8.6.2/server/scripts/cloud-scripts
+ cp /opt/solr/bin/solr.in.sh /etc/default/solr.in.sh
cp: can't create '/etc/default/solr.in.sh': No such file or directory
I fixed the problem by using the Redhat OpenJDK UBI image (ubi8/openjdk-8)
You will have to add the following lines in your dockerfile. I have also added redhat UBI image link for reference.
Hope this helps anyone else who may get stuck :)
FROM registry.access.redhat.com/ubi8/openjdk-8
https://catalog.redhat.com/software/containers/search?q=ubi8%2Fopenjdk-11&p=1

unable to run jmx file in docker

Connected server from windows machine using cygwin
Created one docker file in server
[root#serverhost uname]# touch Dockerfile
[root#serverhost uname]# vi Dockerfile
Dockerfile:
#1
FROM artifactory.xxx.net/java:8.212.0.1557388225_openjdk_74e62a71
#2
LABEL maintainer="xxx#domain.com"
# 3
ARG JMETER_VERSION="5.2"
# 4
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN ${JMETER_HOME}/bin
ENV MIRROR_HOST http://mirrors.ocf.berkeley.edu/apache/jmeter
ENV JMETER_DOWNLOAD_URL ${MIRROR_HOST}/binaries/apache-jmeter-${JMETER_VERSION}.tgz
ENV JMETER_PLUGINS_DOWNLOAD_URL http://repo1.maven.org/maven2/kg/apc
ENV JMETER_PLUGINS_FOLDER ${JMETER_HOME}/lib/ext/
# 5
RUN apk update \
&& apk upgrade \
&& apk add ca-certificates \
&& update-ca-certificates \
&& apk add --update openjdk8-jre tzdata curl unzip bash \
&& cp /usr/share/zoneinfo/Europe/Rome /etc/localtime \
&& echo "Europe/Rome" > /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
# 6
RUN curl -L --silent ${JMETER_PLUGINS_DOWNLOAD_URL}/jmeter-plugins-dummy/0.2/jmeter-plugins-dummy-0.2.jar -o ${JMETER_PLUGINS_FOLDER}/jmeter-plugins-dummy-0.2.jar
RUN curl -L --silent ${JMETER_PLUGINS_DOWNLOAD_URL}/jmeter-plugins-cmn-jmeter/0.5/jmeter-plugins-cmn-jmeter-0.5.jar -o ${JMETER_PLUGINS_FOLDER}/jmeter-plugins-cmn-jmeter-0.5.jar
# 7
ENV PATH $PATH:$JMETER_BIN
# 8
COPY launch.sh /
#9
WORKDIR ${JMETER_HOME}
#10
ENTRYPOINT ["/launch.sh"]
Created launch.sh file in same folder where docker is created
[root#serverhost uname]# touch launch.sh
[root#serverhost uname]# vi launch.sh
launch.sh file
#!/bin/bash
set -e
freeMem=`awk '/MemFree/ { print int($2/1024) }' /proc/meminfo`
s=$(($freeMem/10*8))
x=$(($freeMem/10*8))
n=$(($freeMem/10*2))
export JVM_ARGS="-Xmn${n}m -Xms${s}m -Xmx${x}m"
echo "START Running Jmeter on `date`"
echo "JVM_ARGS=${JVM_ARGS}"
echo "jmeter args=$#"
# Keep entrypoint simple: we must pass the standard JMeter arguments
jmeter $#
echo "END Running Jmeter on `date`"
Built the docker and tagged it
[root#serverhost uname]# docker build .
[root#serverhost uname]# docker tag 090847728937 jmautomation:1.0
exit from server and copied my local jmx file folder to server
uname#QINDW191 /cygdrive/c/jmeter/$ scp -r jmeterscript uname#serverhost:~/
[uname#serverhost~]$ ls -lrt
total 12
-rw-r--r--. 1 root root 1678 Nov 26 10:29 Dockerfile
-rw-r--r--. 1 root root 331 Nov 26 11:00 launch.sh
drwxrwx---. 2 uname uname 4096 Nov 28 09:17 jmeterscript
Running jmx file in docker by copying folder to docker mnt/jmeter folder and running jmx file from there:
[root#serverhost uname]# docker run -v /home/uname/jmeterscript:/mnt/jmeter jmautomation:1.0 -n -Jenv=devint -t /mnt/jmeter/api_regression.jmx -l /mnt/jmeter/result.xml
[root#serverhost uname]# docker run --volume "/home/uname/jmeterscript":/mnt/jmeter jmautomation:1.0 -n -Jenv=devint -t /mnt/jmeter/api_regression.jmx -l /mnt/jmeter/result.xml
[root#serverhost uname]# docker run --volume "/home/uname/jmeterscript":/mnt/jmeter jmautomation:1.0 -n -Jenv="devint" -t /mnt/jmeter/api_regression.jmx -l /mnt/jmeter/result.xml
[root#serverhost uname]# docker run --volume "/home/uname/jmeterscript":/mnt jmautomation:1.0 -n -Jenv=devint -t /mnt/api_regression.jmx -l /mnt/result.xml
Tried to run with all above commands every time I am facing below error
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"-n\": executable file not found in $PATH": unknown.
ERRO[0001] error waiting for container: context canceled
Can anyone please help me what I am missing?

alpine linux do not execute compiled nodejs

I'm trying to set up my docker file without success.
This is what i'm trying to do:
FROM alpine:3.5
ENV VERSION=4.8.1
RUN apk add --no-cache curl make gcc g++ python linux-headers binutils-gold gnupg libstdc++ tar xz && \
curl -sSL -o node.tar.xz https://nodejs.org/download/release/v${VERSION}/node-v${VERSION}-linux-x64.tar.xz && \
tar xJf node.tar.xz -C /usr/local --strip-components 1
CMD ["node", "--version"]
what I get as response is this:
Step 1 : FROM alpine:3.5
---> 4a415e366388
Step 2 : ENV VERSION 4.8.1
---> Using cache
---> 69c1a9ea15a9
Step 3 : RUN apk add --no-cache curl make gcc g++ python linux-headers binutils-gold gnupg libstdc++ tar xz && curl -sSL -o node.tar.xz https://nodejs.org/download/release/v${VERSION}/node-v${VERSION}-linux-x64.tar.xz && tar xJf node.tar.xz -C /usr/local --strip-components 1
---> Using cache
---> 7f508d49e0bc
Step 4 : CMD node --version
---> Running in 196a2ed982fd
---> c0e1fbc1fe23
Removing intermediate container 196a2ed982fd
Successfully built c0e1fbc1fe23
+ docker -H tcp://tjsu250n:2375 run --restart=always --name=barcode -d -p 9002:9001 tjdft_gesirh/barcode:194
c8483a53359d8a26b2f7e3e3bd01b3185a235f7722687f3aadf9c4ff6d4ac540
+ docker -H tcp://tjsu250n:2375 images -a
+ grep tjdft_gesirh/barcode
+ expr 194 - 1
+ awk {print $1}
+ grep 193
+ [ != ]
/tmp/hudson6046350871523920710.sh: 14: [: !=: unexpected operator
Finished: SUCCESS
But despite of that message, the command docker logs xpto returns:
standard_init_linux.go:175: exec user process caused "no such file or directory"
if I use RUN command to run this:
RUN ls -la /usr/local/bin/ && \
echo $PATH && \
npm --version
I get this as response:
Step 4 : RUN ls -la /usr/local/bin/ && echo $PATH && npm --version && ./usr/local/bin/node --version
---> Running in 1b6bd429d169
total 24244
drwxrwxr-x 2 500 500 27 Mar 21 19:14 .
drwxr-xr-x 6 root root 101 Mar 23 21:02 ..
-rwxrwxr-x 1 500 500 24825844 Mar 21 19:14 node
lrwxrwxrwx 1 500 500 38 Mar 21 19:14 npm -> ../lib/node_modules/npm/bin/npm-cli.js
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[91m/usr/local/bin/npm: exec: line 2: /usr/local/bin/node: not found
[0mtime="2017-03-23T18:12:59-03:00" level=info msg="The command '/bin/sh -c ls -la /usr/local/bin/ && \techo $PATH && \tnpm --version && \t./usr/local/bin/node --version' returned a non-zero code: 127"
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I need some help.
## Edit ##
The error /usr/local/bin/node: not found occurred with oracle java too. Don't know why it is not executable from alpine.
I think you need to build node on alpine due to musl-libc.
See the official 7.7 alpine Dockerfile that does a build compared to the 7.7 Debian Dockerfile which uses the pre built package.
Alpine also do nodejs apk packages but they won't be as up to date as the release on nodejs.org.
It is possible to use apk to download nodejs. Package details can be found here
apk add nodejs
should install nodejs 6.10.1-r0.
Although building from source can be fun and challenging! Examples can be found here and here
Hope that helps!

Resources