Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

V2 #1

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
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM golang:1.9-alpine AS build
RUN apk --no-cache update && \
apk --no-cache add make ca-certificates git && \
rm -rf /var/cache/apk/*
WORKDIR /go/src/github.com/sethpollack/ecr-cleaner
RUN go get -u github.com/golang/dep/cmd/dep
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -v -vendor-only
FROM golang:1.21-alpine AS builder
WORKDIR /
RUN apk --no-cache add ca-certificates git && rm -rf /var/cache/apk/*
ENV GO111MODULE=auto
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o bin/ecr-cleaner
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o ecr-cleaner

FROM scratch
LABEL maintainer="Seth Pollack <seth@sethpollack.net>"
COPY --from=build /etc/ssl/certs/ /etc/ssl/certs/
COPY --from=build /go/src/github.com/sethpollack/ecr-cleaner/bin/ecr-cleaner /usr/local/bin/ecr-cleaner
FROM alpine:3
RUN apk --no-cache add ca-certificates && rm -rf /var/cache/apk/*
WORKDIR /usr/local/bin/
RUN adduser -D -H -s /usr/sbin/nologin app
USER app
# RUN mkdir /home/app
COPY --from=builder ecr-cleaner ./
COPY aws/ /home/app/.aws/
ENTRYPOINT ["/usr/local/bin/ecr-cleaner"]
CMD ["--help"]
68 changes: 0 additions & 68 deletions Gopkg.lock

This file was deleted.

34 changes: 0 additions & 34 deletions Gopkg.toml

This file was deleted.

Loading