Skip to content
Permalink
Browse files

make kindnetd image buildable

  • Loading branch information...
BenTheElder committed May 7, 2019
1 parent a5377a1 commit 4d0f5b5ddb805bbbd39763df438c145f575316b4
Showing with 43 additions and 6 deletions.
  1. +12 −0 .dockerignore
  2. +4 −6 images/kindnetd/Dockerfile
  3. +27 −0 images/kindnetd/run.sh
@@ -0,0 +1,12 @@
# build / test output
_output/*
_artifacts/*

# git metadata
.git/*

# github metadata
.github/*

# editor metadta
.vscode/*
@@ -17,16 +17,14 @@ FROM golang:1.12 AS builder
# golang envs
ARG GOARCH="amd64"
ARG GOOS=linux
ENV GO111MODULE=on
ENV CGO_ENABLED=0
# copy in sources
WORKDIR /go/src/kindnet
WORKDIR /go/src/sigs.k8s.io/kind
COPY . .
# build
RUN go get -d -v ./...
RUN go build -o /go/bin/kindnet ./cmd/kindnetd
RUN go build -o /go/bin/kindnetd ./cmd/kindnetd

# STEP 2: Build small image
FROM scratch
COPY --from=builder /go/bin/kindnet /bin/kindnet
CMD ["/bin/kindnet"]
COPY --from=builder /go/bin/kindnetd /bin/kindnetd
CMD ["/bin/kindnetd"]
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copyright 2019 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.

set -o nounset
set -o errexit
set -o pipefail

# cd to the repo root
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "${REPO_ROOT}"

# TODO: verisoning
IMAGE="kindest/kindnetd"
VERSION="0.1.0"
docker build -t "${IMAGE}:${VERSION}" -f images/kindnetd/Dockerfile .

0 comments on commit 4d0f5b5

Please sign in to comment.
You can’t perform that action at this time.