Skip to content

Commit b5d2d74

Browse files
authored
updating dockerfile for AMD/ARM (#34)
* updating dockerfile for AMD/ARM Signed-off-by: Jeff Hollan <[email protected]> * add CGO_ENABLED=0 to Dockerfile Signed-off-by: Jeff Hollan <[email protected]>
1 parent 372a552 commit b5d2d74

35 files changed

+46
-8465
lines changed

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
FROM golang:1.12.1 as builder
1+
FROM golang:1.18 as builder
2+
ENV CGO_ENABLED=0
23

3-
# Copy the code from the host and compile it
4-
WORKDIR $GOPATH/src/github.com/kedacore/sample-go-rabbitmq
4+
WORKDIR /send-src
5+
COPY ./send/go.mod ./send/go.sum ./
6+
RUN go mod download
7+
COPY ./send/* ./
8+
RUN go build -o /send
59

6-
COPY . .
10+
WORKDIR /receive-src
11+
COPY ./receive/go.mod ./receive/go.sum ./
12+
RUN go mod download
13+
COPY ./receive/* ./
14+
RUN go build -o /receive
715

8-
RUN CGO_ENABLED=0 GOOS=linux go install ./...
916

1017
FROM scratch
11-
COPY --from=builder /go/bin/receive /go/bin/send /usr/local/bin/
18+
COPY --from=builder /receive /send /usr/local/bin/
1219
CMD ["receive"]

Gopkg.lock

Lines changed: 0 additions & 17 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 30 deletions
This file was deleted.

deploy/deploy-consumer.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
spec:
2424
containers:
2525
- name: rabbitmq-consumer
26-
image: jeffhollan/rabbitmq-client:dev
26+
image: ghcr.io/kedacore/rabbitmq-client:v1.0
2727
imagePullPolicy: Always
2828
command:
2929
- receive
@@ -60,3 +60,4 @@ spec:
6060
name: rabbitmq-consumer-secret
6161
key: RabbitMqHost
6262
---
63+

deploy/deploy-publisher-job.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ spec:
66
template:
77
spec:
88
containers:
9-
- name: rabbitmq-client
10-
image: jeffhollan/rabbitmq-client:dev
11-
imagePullPolicy: Always
12-
command: ["send", "amqp://user:[email protected]:5672", "300"]
9+
- name: rabbitmq-client
10+
image: ghcr.io/kedacore/rabbitmq-client:v1.0
11+
imagePullPolicy: Always
12+
command:
13+
[
14+
"send",
15+
"amqp://user:[email protected]:5672",
16+
"300",
17+
]
1318
restartPolicy: Never
1419
backoffLimit: 4
15-

receive/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/kedacore/sample-go-rabbitmq/receive
2+
3+
go 1.18
4+
5+
require github.com/streadway/amqp v1.0.0

receive/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo=
2+
github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
File renamed without changes.

send/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/kedacore/sample-go-rabbitmq/send
2+
3+
go 1.18
4+
5+
require github.com/streadway/amqp v1.0.0

send/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo=
2+
github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=

0 commit comments

Comments
 (0)