Skip to content

Commit

Permalink
Add portmap binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Leao committed Aug 9, 2018
1 parent e7e7085 commit 3a6fbec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
VERSION ?= $(shell git describe --tags --always --dirty)
LDFLAGS ?= -X main.version=$(VERSION)

# Download portmap plugin
download-portmap:
mkdir -p tmp/downloads
mkdir -p tmp/plugins
curl -L -o tmp/downloads/cni-plugins-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v0.6.0/cni-plugins-amd64-v0.6.0.tgz
tar -vxf tmp/downloads/cni-plugins-amd64.tgz -C tmp/plugins
cp tmp/plugins/portmap .
rm -rf tmp

# Default to build the Linux binary
build-linux:
GOOS=linux CGO_ENABLED=0 go build -o aws-k8s-agent -ldflags "$(LDFLAGS)"
Expand All @@ -26,7 +35,7 @@ docker-build:
docker run -v $(shell pwd):/usr/src/app/src/github.com/aws/amazon-vpc-cni-k8s \
--workdir=/usr/src/app/src/github.com/aws/amazon-vpc-cni-k8s \
--env GOPATH=/usr/src/app \
golang:1.10 make build-linux
golang:1.10 make build-linux && make download-portmap


# Build docker image
Expand Down Expand Up @@ -64,3 +73,4 @@ vet:
clean:
rm -f aws-k8s-agent
rm -f aws-cni
rm -f portmap
2 changes: 2 additions & 0 deletions scripts/dockerfiles/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ WORKDIR /app
COPY aws-cni /app
COPY misc/10-aws.conflist /app

COPY portmap /app

COPY aws-k8s-agent /app
COPY scripts/aws-cni-support.sh /app
COPY scripts/install-aws.sh /app
Expand Down
1 change: 1 addition & 0 deletions scripts/install-aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
echo "=====Starting installing AWS-CNI ========="
sed -i s/__VETHPREFIX__/${AWS_VPC_K8S_CNI_VETHPREFIX:-"eni"}/g /app/10-aws.conflist
cp /app/aws-cni /host/opt/cni/bin/
cp /app/portmap /host/opt/cni/bin/
cp /app/aws-cni-support.sh /host/opt/cni/bin/
cp /app/10-aws.conflist /host/etc/cni/net.d/
echo "=====Starting amazon-k8s-agent ==========="
Expand Down

0 comments on commit 3a6fbec

Please sign in to comment.