chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
FROM eclipse-temurin:25-jdk
|
||||
|
||||
MAINTAINER Apache HertzBeat "dev@hertzbeat.apache.org"
|
||||
|
||||
ARG VERSION
|
||||
|
||||
# Install SSH
|
||||
RUN sed -i 's#http://#https://#g' /etc/apt/sources.list.d/ubuntu.sources && \
|
||||
apt-get update && apt-get install -y openssh-server
|
||||
RUN mkdir -p /var/run/sshd
|
||||
|
||||
ADD apache-hertzbeat-collector-${VERSION}-bin.tar.gz /opt/
|
||||
|
||||
ENV JAVA_OPTS ""
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV LANG=en_US.UTF-8
|
||||
|
||||
WORKDIR /opt/apache-hertzbeat-collector-${VERSION}-bin/
|
||||
|
||||
ENTRYPOINT ["./bin/entrypoint.sh"]
|
||||
@@ -0,0 +1,29 @@
|
||||
## Use the buildx to build Docker images that support multiple system architectures
|
||||
|
||||
> https://vuepress.mirror.docker-practice.com/buildx/multi-arch-images/
|
||||
|
||||
|
||||
```shell
|
||||
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master
|
||||
|
||||
# for tencent environment
|
||||
$ docker buildx create --use --name=mybuilder-cn --driver docker-container --driver-opt image=dockerpracticesig/buildkit:master-tencent
|
||||
|
||||
$ docker buildx create --use --name mybuilder --driver docker-container
|
||||
|
||||
$ docker buildx use mybuilder
|
||||
|
||||
```
|
||||
|
||||
#### Build the image
|
||||
|
||||
```shell
|
||||
# Use the --platform flag to specify the target platforms for the build --push flag to push the image to a registry
|
||||
$ docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:1.0.0 . --push
|
||||
|
||||
$ docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:latest . --push
|
||||
|
||||
# Inspect the image info
|
||||
$ docker buildx imagetools inspect apache/hertzbeat-collector:1.0.0
|
||||
|
||||
```
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
cd `dirname $0`
|
||||
# current dir
|
||||
CURRENT_DIR=`pwd`
|
||||
# cd dist dir
|
||||
cd ../../../dist
|
||||
# auto detect the JVM collector package version
|
||||
PACKAGE_FILE=$(find . -maxdepth 1 -name 'apache-hertzbeat-collector-*-bin.tar.gz' \
|
||||
! -name 'apache-hertzbeat-collector-native-*-bin.tar.gz' | head -n 1)
|
||||
VERSION=$(basename "$PACKAGE_FILE" | sed -e 's/^apache-hertzbeat-collector-//' -e 's/-bin\.tar\.gz$//')
|
||||
# use the version param
|
||||
if [ -n "$1" ]; then
|
||||
VERSION="$1";
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Can not find the JVM collector package under dist/. Build apache-hertzbeat-collector-{version}-bin.tar.gz first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# docker compile context
|
||||
CONTEXT_DIR=`pwd`
|
||||
|
||||
COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
|
||||
|
||||
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t apache/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
|
||||
|
||||
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
|
||||
|
||||
#COMMAND="docker buildx build --platform linux/arm64,linux/amd64 -t quay.io/tancloud/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" --push"
|
||||
|
||||
# Build Local
|
||||
|
||||
#COMMAND="docker build -t apache/hertzbeat-collector:$VERSION -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR --build-arg VERSION="$VERSION" "
|
||||
|
||||
echo "$COMMAND"
|
||||
|
||||
$COMMAND
|
||||
|
||||
#docker build -t apache/hertzbeat-collector:latest -f $CURRENT_DIR/Dockerfile $CONTEXT_DIR
|
||||
Reference in New Issue
Block a user