chore: create httpbun image (#9926)

Signed-off-by: Spazzy <brendankamp757@gmail.com>
This commit is contained in:
Brendan Kamp 2023-05-05 14:27:13 +02:00 committed by GitHub
parent f48b03be54
commit 6d91c2a54c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 19 deletions

View file

@ -0,0 +1,34 @@
# Copyright 2019 The Kubernetes Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.20 AS builder
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV HTTPBUN_COMMIT=a6b387c438b664322734250e426b6966966c2fe4
RUN git clone https://github.com/sharat87/httpbun.git
WORKDIR httpbun
RUN git checkout $HTTPBUN_COMMIT
RUN CGO_ENABLED=0 GOOS=linux go build \
-installsuffix cgo \
-trimpath \
-o bin/httpbun .
FROM scratch
COPY --from=builder /go/httpbun/bin/httpbun httpbun
ENV HTTPBUN_BIND=0.0.0.0:80
EXPOSE 80
ENTRYPOINT ["/httpbun"]