Skip to content

Multi-architecture support for s3-resource Dockerfile #184

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
23 changes: 10 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
ARG base_image
ARG base_image=cgr.dev/chainguard/wolfi-base
ARG builder_image=concourse/golang-builder

FROM ${builder_image} as builder
COPY . /go/src/github.com/concourse/s3-resource
WORKDIR /go/src/github.com/concourse/s3-resource
ENV CGO_ENABLED 0
COPY . .
RUN go mod download
RUN go build -o /assets/in ./cmd/in
RUN go build -o /assets/out ./cmd/out
RUN go build -o /assets/check ./cmd/check
RUN set -e; for pkg in $(go list ./...); do \
RUN set -e; for pkg in "$(go list ./...)"; do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM ${base_image} AS resource
USER root
RUN apt update && apt upgrade -y -o Dpkg::Options::="--force-confdef"
RUN apt update \
&& apt install -y --no-install-recommends \
tzdata \
ca-certificates \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN apk --no-cache add \
ca-certificates \
tzdata \
unzip \
zip && \
rm -rf /var/cache/apk/*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this when using --no-cache


COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ will stop the build.
Run the tests with the following command:

```sh
docker build -t s3-resource --target tests --build-arg base_image=paketobuildpacks/run-jammy-base:latest .
docker build -t s3-resource --target tests .
```

#### Integration tests
Expand Down