Skip to content

Commit

Permalink
chore: create httpbun image (#9926)
Browse files Browse the repository at this point in the history
Signed-off-by: Spazzy <[email protected]>
  • Loading branch information
Spazzy757 authored May 5, 2023
1 parent f48b03b commit 6d91c2a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ jobs:
- 'images/echo/**'
go-grpc-greeter-server:
- 'images/go-grpc-greeter-server/**'
httpbin:
- 'images/httpbin/**'
httpbun:
- 'images/httpbun/**'
kube-webhook-certgen:
- 'images/kube-webhook-certgen/**'
ext-auth-example-authsvc:
Expand All @@ -422,10 +422,10 @@ jobs:
if: ${{ steps.filter-images.outputs.go-grpc-greeter-server == 'true' }}
run: |
cd images/go-grpc-greeter-server && make build
- name: httpbin image build
- name: httpbun image build
if: ${{ steps.filter-images.outputs.httpbin == 'true' }}
run: |
cd images/httpbin && make build
cd images/httpbun && make build
- name: kube-webhook-certgen image build
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }}
run: |
Expand Down
3 changes: 2 additions & 1 deletion images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ custom-error-pages | Example of Custom error pages for the NGINX Ingress control
e2e | Image to run e2e tests
fastcgi-helloserver | FastCGI application for e2e tests
grpc-fortune-teller | grpc server application for the nginx-ingress grpc example
httpbin | A simple HTTP Request & Response Service for e2e tests
httpbun | A simple HTTP Request & Response Service for e2e tests
httpbin | [Removed] we are no longer maintaining the httpbin image due to project being unmaintained
nginx | NGINX base image using [alpine linux](https://www.alpinelinux.org)
cfssl | Image to run cfssl commands
2 changes: 1 addition & 1 deletion images/httpbin/Makefile → images/httpbun/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TAG ?=v$(shell date +%Y%m%d)-$(SHORT_SHA)

REGISTRY ?= local

IMAGE = $(REGISTRY)/e2e-test-httpbin
IMAGE = $(REGISTRY)/e2e-test-httpbun

# required to enable buildx
export DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
- -c
- |
gcloud auth configure-docker \
&& cd images/httpbin && make push
&& cd images/httpbun && make push
substitutions:
_GIT_TAG: "12345"
_PULL_BASE_REF: "master"
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.17.2
FROM golang:1.20 AS builder

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV HTTPBUN_COMMIT=a6b387c438b664322734250e426b6966966c2fe4

RUN apk upgrade && apk update \
&& apk add --no-cache \
python3 python3-dev \
musl-dev gcc g++ make \
libffi libffi-dev libstdc++ \
py3-gevent py3-gunicorn py3-wheel \
py3-pip \
&& pip3 install httpbin \
&& apk del python3-dev musl-dev gcc g++ make libffi-dev
RUN git clone https://github.com/sharat87/httpbun.git
WORKDIR httpbun
RUN git checkout $HTTPBUN_COMMIT

EXPOSE 80
RUN CGO_ENABLED=0 GOOS=linux go build \
-installsuffix cgo \
-trimpath \
-o bin/httpbun .

CMD ["gunicorn", "-b", "0.0.0.0:80", "httpbin:app", "-k", "gevent"]
FROM scratch
COPY --from=builder /go/httpbun/bin/httpbun httpbun
ENV HTTPBUN_BIND=0.0.0.0:80
EXPOSE 80
ENTRYPOINT ["/httpbun"]

0 comments on commit 6d91c2a

Please sign in to comment.