Skip to content

Commit

Permalink
Update license, moving to quay, updates from k8s PR
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislovecnm committed Mar 2, 2017
1 parent ad0ce98 commit 5d1773e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017 The Kubernetes Authors.
# Copyright 2017 K8s For Greeks / Vorstella
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@ FROM gcr.io/google_containers/ubuntu-slim:0.6
ARG BUILD_DATE
ARG VCS_REF
ARG CASSANDRA_VERSION
ARG DEV_CONTAINER

LABEL \
org.label-schema.build-date=$BUILD_DATE \
Expand Down Expand Up @@ -51,13 +52,17 @@ RUN set -e && echo 'debconf debconf/frontend select Noninteractive' | debconf-se
) \
&& wget -q -O - ${mirror_url}/${CASSANDRA_VERSION}/apache-cassandra-${CASSANDRA_VERSION}-bin.tar.gz \
| tar -xzf - -C /usr/local \
&& wget -q -O - https://github.com/Yelp/dumb-init/releases/download/v${DI_VERSION}/dumb-init_${DI_VERSION}_amd64 > /sbin/dumb-init \
&& wget -q -O - https://github.com/Yelp/dumb-init/releases/download/v${DI_VERSION}/dumb-init_${DI_VERSION}_amd64 > /sbin/dumb-init \
&& echo "$DI_SHA /sbin/dumb-init" | sha256sum -c - \
&& chmod +x /sbin/dumb-init \
&& chmod +x /ready-probe.sh \
&& mkdir -p /cassandra_data/data \
&& mkdir -p /etc/cassandra \
&& mv /logback.xml /cassandra.yaml /jvm.options /etc/cassandra/ \
&& mv /usr/local/apache-cassandra-${CASSANDRA_VERSION}/conf/cassandra-env.sh /etc/cassandra/ \
&& adduser --disabled-password --no-create-home --gecos '' --disabled-login cassandra \
&& chown cassandra: /ready-probe.sh \
&& if [ -n "$DEV_CONTAINER" ]; then apt-get -y --no-install-recommends install python; else rm -rf $CASSANDRA_HOME/pylib; fi \
&& apt-get -y purge wget localepurge \
&& apt-get autoremove \
&& apt-get clean \
Expand All @@ -68,7 +73,6 @@ RUN set -e && echo 'debconf debconf/frontend select Noninteractive' | debconf-se
$CASSANDRA_HOME/tools/*.yaml \
$CASSANDRA_HOME/tools/bin/*.bat \
$CASSANDRA_HOME/bin/*.bat \
$CASSANDRA_HOME/pylib \
doc \
man \
info \
Expand Down Expand Up @@ -112,7 +116,7 @@ RUN set -e && echo 'debconf debconf/frontend select Noninteractive' | debconf-se
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/nashorn.jar \
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/oblique-fonts \
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/plugin.jar \
/usr/lib/jvm/java-8-openjdk-amd64/man
/usr/lib/jvm/java-8-openjdk-amd64/man

VOLUME ["/$CASSANDRA_DATA"]

Expand Down
20 changes: 6 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016 The Kubernetes Authors.
# Copyright 2017 K8s For Greeks / Vorstella
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,27 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# build the cassandra image.

VERSION=v12
PROJECT_ID=google_samples
PROJECT=gcr.io/${PROJECT_ID}
VERSION=v1.0
PROJECT_ID=vorstella
PROJECT=quay.io/${PROJECT_ID}
CASSANDRA_VERSION=3.9

all: build

kubernetes-cassandra.jar: ../java/* ../java/src/main/java/io/k8s/cassandra/*.java
cd ../java && mvn clean && mvn package
mv ../java/target/kubernetes-cassandra*.jar files/kubernetes-cassandra.jar
cd ../java && mvn clean


docker:
docker build --pull --build-arg "CASSANDRA_VERSION=${CASSANDRA_VERSION}" -t ${PROJECT}/cassandra:${VERSION} .

build: kubernetes-cassandra.jar docker
build: docker

push: build
gcloud docker -- push ${PROJECT}/cassandra:${VERSION}
docker push ${PROJECT}/cassandra:${VERSION}

.PHONY: all build push
Binary file removed files/kubernetes-cassandra.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions files/ready-probe.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors.
# Copyright 2017 K8S For Greeks / Vorstella
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@ if [[ $(nodetool status | grep $POD_IP) == *"UN"* ]]; then
exit 0;
else
if [[ $DEBUG ]]; then
echo "UN";
echo "Up";
fi
exit 1;
fi
4 changes: 1 addition & 3 deletions files/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors.
# Copyright 2016 K8s For Greeks / Vorstella
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -171,6 +171,4 @@ fi
chmod 700 "${CASSANDRA_DATA}"
chown -c -R cassandra "${CASSANDRA_DATA}" "${CASSANDRA_CONF_DIR}"

export CLASSPATH=/kubernetes-cassandra.jar

su cassandra -c "$CASSANDRA_HOME/bin/cassandra -f"

0 comments on commit 5d1773e

Please sign in to comment.