Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions pulsar-client-cpp/docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# 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 python:3.7-alpine3.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of 3.7 we should use PYTHON_VERSION variable


RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
bash \
git \
openssh \
cmake \
libressl-dev \
curl-dev \
protobuf-dev \
boost-dev \
gtest-dev \
make \
build-base \
python3-dev \
zstd-dev \
snappy-dev \
libffi-dev

RUN pip install --no-cache-dir twine wheel
43 changes: 43 additions & 0 deletions pulsar-client-cpp/docker/alpine/create-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
#
# 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.
#


# Create all the Docker images for variations of Python versions

set -e

PYTHON_VERSIONS=(
'3.7 cp37-cp37m'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp37-cp37m this is specific to the manilinux base images. It's not relevant here

)

for line in "${PYTHON_VERSIONS[@]}"; do
read -r -a PY <<< "$line"
PYTHON_VERSION=${PY[0]}
PYTHON_SPEC=${PY[1]}
echo "--------- Build Docker image for $PYTHON_VERSION -- $PYTHON_SPEC"

IMAGE_NAME=pulsar-build:alpine-$PYTHON_SPEC

docker build -t $IMAGE_NAME . \
--build-arg PYTHON_VERSION=$PYTHON_VERSION \
--build-arg PYTHON_SPEC=$PYTHON_SPEC

echo "==== Successfully built image $IMAGE_NAME"
done
46 changes: 46 additions & 0 deletions pulsar-client-cpp/docker/alpine/push-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#
# 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.
#


# Create all the Docker images for variations of Python versions

set -e

DOCKER_ORG=apachepulsar

PYTHON_VERSIONS=(
'3.7 cp37-cp37m'
)

for line in "${PYTHON_VERSIONS[@]}"; do
read -r -a PY <<< "$line"
PYTHON_VERSION=${PY[0]}
PYTHON_SPEC=${PY[1]}

IMAGE_NAME=pulsar-build:alpine-$PYTHON_SPEC
FULL_NAME=$DOCKER_ORG/$IMAGE_NAME

echo "IMAGE_NAME: $IMAGE_NAME"
echo "FULL_NAME: $FULL_NAME"
docker tag $IMAGE_NAME $FULL_NAME
docker push $FULL_NAME

echo "==== Successfully pushed image $FULL_NAME"
done