Skip to content
Merged
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
45 changes: 32 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
ARG base_image
ARG base_image=cgr.dev/chainguard/wolfi-base
ARG builder_image=concourse/golang-builder

FROM ${builder_image} as builder
ARG BUILDPLATFORM
FROM --platform=${BUILDPLATFORM} ${builder_image} AS builder

ARG TARGETOS
ARG TARGETARCH
ENV GOOS=$TARGETOS
ENV GOARCH=$TARGETARCH

WORKDIR /src
COPY . .
RUN go mod download
Expand All @@ -10,10 +17,27 @@ RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM ${base_image} AS proxybuilder
RUN apk --no-cache add \
git \
gcc \
make \
openssl-dev

WORKDIR /root
RUN git clone https://github.com/proxytunnel/proxytunnel.git && \
cd proxytunnel && \
make -j4 && \
install -c proxytunnel /usr/bin/proxytunnel && \
cd .. && \
rm -rf proxytunnel

FROM ${base_image} AS resource
USER root
RUN apt update && apt upgrade -y -o Dpkg::Options::="--force-confdef"
RUN apt update && apt install -y jq git make g++ libssl-dev openssh-client
RUN apk --no-cache add \
bash \
jq \
git \
openssh-client
RUN git config --global user.email "git@localhost"
RUN git config --global user.name "git"

Expand All @@ -22,15 +46,10 @@ RUN chmod +x /opt/resource/*
COPY --from=builder /assets /opt/go
RUN chmod +x /opt/go/out

WORKDIR /root
RUN git clone https://github.com/proxytunnel/proxytunnel.git && \
cd proxytunnel && \
make -j4 && \
install -c proxytunnel /usr/bin/proxytunnel && \
cd .. && \
rm -rf proxytunnel
COPY --from=proxybuilder /usr/bin/proxytunnel /usr/bin/

FROM resource AS tests
RUN apk --no-cache add git-daemon cmd:ssh-keygen
COPY --from=builder /tests /go/resource-tests/
RUN set -e; for test in /go/resource-tests/*.test; do \
$test; \
Expand All @@ -39,7 +58,7 @@ ADD test/ /opt/resource-tests
RUN /opt/resource-tests/all.sh

FROM resource AS integrationtests
RUN apt update && apt install -y squid net-tools
RUN apk --no-cache add squid net-tools
ADD test/ /opt/resource-tests/test
ADD integration-tests /opt/resource-tests/integration-tests
RUN /opt/resource-tests/integration-tests/integration.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ will stop the build.
Run the tests with the following command:

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

#### Note about the integration tests
Expand All @@ -329,7 +329,7 @@ contents to understand the directory structure expected by the integration tests
Then run the tests:

```sh
docker build -t pool-resource --build-arg base_image=concourse/golang-builder --target integrationtests .
docker build -t pool-resource --target integrationtests .
```

### Contributing
Expand Down
13 changes: 0 additions & 13 deletions ci/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions ci/build

This file was deleted.