mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 05:30:26 +00:00
fix examples/ compilation so that test/ also compiles
fix network-tester cauldron serve_hostnames
This commit is contained in:
1
examples/guestbook-go/.gitignore
vendored
Normal file
1
examples/guestbook-go/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
guestbook_bin
|
19
examples/guestbook-go/BUILD
Normal file
19
examples/guestbook-go/BUILD
Normal file
@@ -0,0 +1,19 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "guestbook-go",
|
||||
srcs = ["main.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//vendor:github.com/codegangsta/negroni",
|
||||
"//vendor:github.com/gorilla/mux",
|
||||
"//vendor:github.com/xyproto/simpleredis",
|
||||
],
|
||||
)
|
@@ -14,10 +14,10 @@
|
||||
|
||||
FROM busybox:ubuntu-14.04
|
||||
|
||||
ADD ./bin/guestbook /app/guestbook
|
||||
ADD ./_src/public/index.html /app/public/index.html
|
||||
ADD ./_src/public/script.js /app/public/script.js
|
||||
ADD ./_src/public/style.css /app/public/style.css
|
||||
ADD ./guestbook_bin /app/guestbook
|
||||
ADD ./public/index.html /app/public/index.html
|
||||
ADD ./public/script.js /app/public/script.js
|
||||
ADD ./public/style.css /app/public/style.css
|
||||
|
||||
WORKDIR /app
|
||||
CMD ["./guestbook"]
|
@@ -23,6 +23,7 @@ release: clean build push clean
|
||||
|
||||
# builds a docker image that builds the app and packages it into a minimal docker image
|
||||
build:
|
||||
@cp ../../bazel-bin/examples/guestbook-go/guestbook-go guestbook_bin
|
||||
docker build --rm --force-rm -t ${REGISTRY}/guestbook-builder .
|
||||
docker run --rm ${REGISTRY}/guestbook-builder | docker build -t "${REGISTRY}/guestbook:${VERSION}" -
|
||||
|
||||
@@ -32,6 +33,7 @@ push:
|
||||
|
||||
# remove previous images and containers
|
||||
clean:
|
||||
rm -f guestbook_bin
|
||||
docker rm -f ${REGISTRY}/guestbook-builder 2> /dev/null || true
|
||||
docker rmi -f ${REGISTRY}/guestbook-builder || true
|
||||
docker rmi -f "${REGISTRY}/guestbook:${VERSION}" || true
|
@@ -1,23 +0,0 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# 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.6.0
|
||||
|
||||
ADD . /go/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/_src
|
||||
|
||||
WORKDIR /go/src/github.com/GoogleCloudPlatform/kubernetes/examples/guestbook-go/
|
||||
RUN cd _src/ && go get && go build -o ../bin/guestbook
|
||||
RUN cp _src/guestbook/Dockerfile .
|
||||
|
||||
CMD tar cvzf - .
|
@@ -1,25 +0,0 @@
|
||||
## Building and releasing Guestbook Image
|
||||
|
||||
This process employs building two docker images, one compiles the source and the other hosts the compiled binaries.
|
||||
|
||||
Releasing the image requires that you have access to the docker registry user account which will host the image. You can specify the registry including the user account by setting the environment variable `REGISTRY`.
|
||||
|
||||
To build and release the guestbook image:
|
||||
|
||||
cd examples/guestbook-go/_src
|
||||
make release
|
||||
|
||||
To build and release the guestbook image with a different registry and version:
|
||||
|
||||
VERSION=v4 REGISTRY="docker.io/luebken" make build
|
||||
|
||||
If you want to, you can build and push the image step by step:
|
||||
|
||||
make clean
|
||||
make build
|
||||
make push
|
||||
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
Reference in New Issue
Block a user