Skip to content
Open
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
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# ko is (currently) incomptible with cgo, so the AMQP receive adapter is built via Docker.
# ko uses a debian:stretch-slim
FROM debian:stretch-slim as build_stage
FROM debian:stretch-slim
# AS build_stage
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y cmake uuid-dev libssl-dev libsasl2-2 libsasl2-dev libsasl2-modules git gcc python-dev wget
RUN apt-get install -y cmake uuid-dev libssl-dev libsasl2-2 libsasl2-dev libsasl2-modules git gcc python-dev wget libssl-dev libsasl2-2 libsasl2-modules
RUN wget -q https://dl.google.com/go/go1.10.4.linux-amd64.tar.gz && echo fa04efdb17a275a0c6e137f969a1c4eb878939e91e1da16060ce42f02c2ec5ec go1.10.4.linux-amd64.tar.gz | sha256sum -c --quiet && tar -C /usr/local -xzf go1.10.4.linux-amd64.tar.gz && git clone git://git.apache.org/qpid-proton.git
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin
ENV GOPATH=/qpid-proton/build/go CGO_CFLAGS=-I/qpid-proton/build/c/include CGO_LDFLAGS='-L/qpid-proton/build/c -lssl -lcrypto -lsasl2'
Expand All @@ -19,12 +20,14 @@ COPY pkg qpid-proton/build/go/src/github.com/knative/eventing-sources/pkg/
RUN rm -f qpid-proton/build/go/pkg/linux_amd64/qpid.apache.org/*.a && rm -rf /root/.cache/go-build
RUN cd qpid-proton/build/go/src/github.com/knative/eventing-sources/cmd/amqpsource && go install -x

RUN mv /qpid-proton/build/go/bin/amqpsource /amqpsource

# Insert here 2nd stage build step for thinner image.
# Bonus points if can be done via a small increment to gcr.io/distroless/cc, i.e. sasl libs
FROM debian:stretch-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
libssl-dev libsasl2-2 libsasl2-modules \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build_stage qpid-proton/build/go/bin/amqpsource /amqpsource
# FROM debian:stretch-slim
# ENV DEBIAN_FRONTEND noninteractive
# RUN apt-get update && apt-get install -y \
# libssl-dev libsasl2-2 libsasl2-modules \
# && rm -rf /var/lib/apt/lists/*
# COPY --from=build_stage qpid-proton/build/go/bin/amqpsource /amqpsource
ENTRYPOINT ["/amqpsource"]
11 changes: 11 additions & 0 deletions samples/01-channel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
metadata:
name: testchannel
spec:
provisioner:
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel


14 changes: 14 additions & 0 deletions samples/02-eventsource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: sources.eventing.knative.dev/v1alpha1
kind: ContainerSource
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: containersource-sample
spec:
image: sjwoodman/amqp-adaptor:latest
args:
- '--amqpurl=amqp://artemis.myproject.svc.cluster.local:5672/knqueue'
sink:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: testchannel
12 changes: 12 additions & 0 deletions samples/03-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: message-dumper
namespace: myproject
spec:
runLatest:
configuration:
revisionTemplate:
spec:
container:
image: github.com/knative/eventing-sources/cmd/message_dumper
16 changes: 16 additions & 0 deletions samples/04-subscription.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
metadata:
name: testeventssubscription
namespace: myproject
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: testchannel
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
kind: Service
name: message-dumper