Skip to content

Commit 6d91c2a

Browse files
authored
chore: create httpbun image (#9926)
Signed-off-by: Spazzy <[email protected]>
1 parent f48b03b commit 6d91c2a

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ jobs:
395395
- 'images/echo/**'
396396
go-grpc-greeter-server:
397397
- 'images/go-grpc-greeter-server/**'
398-
httpbin:
399-
- 'images/httpbin/**'
398+
httpbun:
399+
- 'images/httpbun/**'
400400
kube-webhook-certgen:
401401
- 'images/kube-webhook-certgen/**'
402402
ext-auth-example-authsvc:
@@ -422,10 +422,10 @@ jobs:
422422
if: ${{ steps.filter-images.outputs.go-grpc-greeter-server == 'true' }}
423423
run: |
424424
cd images/go-grpc-greeter-server && make build
425-
- name: httpbin image build
425+
- name: httpbun image build
426426
if: ${{ steps.filter-images.outputs.httpbin == 'true' }}
427427
run: |
428-
cd images/httpbin && make build
428+
cd images/httpbun && make build
429429
- name: kube-webhook-certgen image build
430430
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }}
431431
run: |

images/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ custom-error-pages | Example of Custom error pages for the NGINX Ingress control
1717
e2e | Image to run e2e tests
1818
fastcgi-helloserver | FastCGI application for e2e tests
1919
grpc-fortune-teller | grpc server application for the nginx-ingress grpc example
20-
httpbin | A simple HTTP Request & Response Service for e2e tests
20+
httpbun | A simple HTTP Request & Response Service for e2e tests
21+
httpbin | [Removed] we are no longer maintaining the httpbin image due to project being unmaintained
2122
nginx | NGINX base image using [alpine linux](https://www.alpinelinux.org)
2223
cfssl | Image to run cfssl commands

images/httpbin/Makefile renamed to images/httpbun/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ TAG ?=v$(shell date +%Y%m%d)-$(SHORT_SHA)
2323

2424
REGISTRY ?= local
2525

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

2828
# required to enable buildx
2929
export DOCKER_CLI_EXPERIMENTAL=enabled

images/httpbin/cloudbuild.yaml renamed to images/httpbun/cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ steps:
1818
- -c
1919
- |
2020
gcloud auth configure-docker \
21-
&& cd images/httpbin && make push
21+
&& cd images/httpbun && make push
2222
substitutions:
2323
_GIT_TAG: "12345"
2424
_PULL_BASE_REF: "master"

images/httpbin/rootfs/Dockerfile renamed to images/httpbun/rootfs/Dockerfile

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM alpine:3.17.2
15+
FROM golang:1.20 AS builder
1616

1717
ENV LC_ALL=C.UTF-8
1818
ENV LANG=C.UTF-8
19+
ENV HTTPBUN_COMMIT=a6b387c438b664322734250e426b6966966c2fe4
1920

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

30-
EXPOSE 80
25+
RUN CGO_ENABLED=0 GOOS=linux go build \
26+
-installsuffix cgo \
27+
-trimpath \
28+
-o bin/httpbun .
3129

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

0 commit comments

Comments
 (0)