Skip to content

Commit

Permalink
Merge pull request #3 from cloud-gov/update-dockerfile
Browse files Browse the repository at this point in the history
fix cf package issue
  • Loading branch information
dandersonsw authored Jul 12, 2024
2 parents 529c2a0 + 8391ae3 commit 7c04eba
Showing 1 changed file with 10 additions and 9 deletions.
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

0 comments on commit 7c04eba

Please sign in to comment.