Skip to content

Commit

Permalink
Cleanup Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Tincelin committed Jun 30, 2021
1 parent cce8000 commit f138222
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/docs
/tests
/builder
/deployment
*.md
34 changes: 25 additions & 9 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
FROM golang AS builder
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build github.com/Azure/aks-periscope/cmd/aks-periscope
# Builder
FROM golang:alpine AS builder

ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

WORKDIR /build

COPY go.mod .
COPY go.sum .
RUN go mod download

COPY . .

RUN go build ./cmd/aks-periscope

# Runner
FROM alpine

RUN apk --no-cache add ca-certificates curl openssl bash

ADD https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl /usr/local/bin/kubectl
RUN chmod +x /usr/local/bin/kubectl

RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 \
&& chmod +x get_helm.sh \
&& ./get_helm.sh
RUN mkdir /app
WORKDIR /app
COPY --from=builder /app/aks-periscope .
CMD ["./aks-periscope"]

COPY --from=builder /build/aks-periscope /

ENTRYPOINT ["/aks-periscope"]
7 changes: 7 additions & 0 deletions deployment/aks-periscope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,20 @@ spec:
name: collectors-config
- secretRef:
name: azureblob-secret
volumeMounts:
- name: varlog
mountPath: /var/log
resources:
requests:
memory: "500Mi"
cpu: "250m"
limits:
memory: "2000Mi"
cpu: "1000m"
volumes:
- name: varlog
hostPath:
path: /var/log
---
apiVersion: v1
kind: Secret
Expand Down
9 changes: 4 additions & 5 deletions deployment/daemon-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ spec:
- configMapRef:
name: nodelogs-config
volumeMounts:
- mountPath: /aks-periscope
name: aks-periscope-storage
- name: varlog
mountPath: /var/log
resources:
requests:
memory: "500Mi"
Expand All @@ -42,7 +42,6 @@ spec:
memory: "2000Mi"
cpu: "1000m"
volumes:
- name: aks-periscope-storage
- name: varlog
hostPath:
path: /var/log/aks-periscope
type: DirectoryOrCreate
path: /var/log

0 comments on commit f138222

Please sign in to comment.