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

fix cf package issue #3

Merged
merged 1 commit into from
Jul 12, 2024
Merged
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: 10 additions & 9 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ARG builder_image=concourse/golang-builder

FROM ${builder_image} as builder
RUN apt update && apt install -y --no-install-recommends \
curl \
jq \
curl \
jq \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /assets
WORKDIR /assets
Expand All @@ -16,25 +16,26 @@ RUN go build -o /assets/in github.com/cloud-gov/cf-resource/in/cmd/in
RUN go build -o /assets/out github.com/cloud-gov/cf-resource/out/cmd/out
RUN go build -o /assets/check github.com/cloud-gov/cf-resource/check/cmd/check
RUN set -e; for pkg in $(go list ./... | grep -v "acceptance"); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM ${base_image} AS resource
RUN apt update && apt upgrade -y -o Dpkg::Options::="--force-confdef"
RUN apt update && apt install -y --no-install-recommends \
tzdata \
ca-certificates \
tzdata \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder assets/ /opt/resource/
RUN chmod +x /opt/resource/*
RUN mv /opt/resource/cf /usr/bin/cf
# move cf and cf8 so the symlink works
RUN mv /opt/resource/cf* /usr/bin/

FROM resource AS tests
COPY --from=builder /tests /go-tests
COPY out/assets /go-tests/assets
WORKDIR /go-tests
RUN set -e; for test in /go-tests/*.test; do \
$test; \
done
$test; \
done

FROM resource