Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d631d8e7
Commit
d631d8e7
authored
Oct 08, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34004 from wojtek-t/all_versions_in_etcd_image
Automatic merge from submit-queue Grab different etcd versions in etcd image. Ref #20504 @timothysc
parents
de55cb85
5c91ac66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
11 deletions
+35
-11
Dockerfile
cluster/images/etcd/Dockerfile
+2
-1
Makefile
cluster/images/etcd/Makefile
+33
-10
No files found.
cluster/images/etcd/Dockerfile
View file @
d631d8e7
...
@@ -16,4 +16,5 @@ FROM BASEIMAGE
...
@@ -16,4 +16,5 @@ FROM BASEIMAGE
MAINTAINER
Dawn Chen <dawnchen@google.com>
MAINTAINER
Dawn Chen <dawnchen@google.com>
EXPOSE
2379 2380 4001 7001
EXPOSE
2379 2380 4001 7001
COPY
etcd etcdctl migrate-if-needed.sh attachlease /usr/local/bin/
COPY
etcd* etcdctl* /usr/local/bin/
COPY
migrate-if-needed.sh attachlease /usr/local/bin/
cluster/images/etcd/Makefile
View file @
d631d8e7
...
@@ -15,10 +15,19 @@
...
@@ -15,10 +15,19 @@
# Build the etcd image
# Build the etcd image
#
#
# Usage:
# Usage:
# [TAG
=3.0.4
] [REGISTRY=gcr.io/google_containers] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
# [TAG
S=2.2.1 2.3.7 3.0.10
] [REGISTRY=gcr.io/google_containers] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
TAG
?=
3.0.4
# The image contains different etcd versions to simplify
REGISTRY_TAG
?=
$(TAG)
# upgrades. Thus be careful when removing any tag from here.
#
# NOTE: The etcd upgrade rules are that you can upgrade only 1 minor
# version at a time, and patch release don't matter.
#
# Except from etcd-$(tag) and etcdctl-$(tag) binaries, we also
# need etcd and etcdctl binaries for backward compatibility reasons.
# That binary will be set to the last tag from $(TAGS).
TAGS
?=
2.2.1 2.3.7 3.0.10
REGISTRY_TAG
?=
3.0.10
ARCH
?=
amd64
ARCH
?=
amd64
REGISTRY
?=
gcr.io/google_containers
REGISTRY
?=
gcr.io/google_containers
GOLANG_VERSION
?=
1.6.3
GOLANG_VERSION
?=
1.6.3
...
@@ -50,16 +59,30 @@ build:
...
@@ -50,16 +59,30 @@ build:
ifeq
($(ARCH),amd64)
ifeq
($(ARCH),amd64)
# Do not compile if we should make an image for amd64, use the official etcd binaries instead
# Do not compile if we should make an image for amd64, use the official etcd binaries instead
curl -sSL --retry 5 https
:
//github.com/coreos/etcd/releases/download/v$(TAG)/etcd-v$(TAG)-linux-amd64.tar.gz | tar -xz -C $(TEMP_DIR) --strip-components=1
# For each release create a tmp dir 'etcd_release_tmp_dir' and unpack the release tar there.
for
tag
in
$(TAGS);
do
\
etcd_release_tmp_dir
=
$(
shell
mktemp
-d
)
;
\
curl
-sSL
--retry
5 https://github.com/coreos/etcd/releases/download/v
$$
tag/etcd-v
$$
tag-linux-amd64.tar.gz |
tar
-xz
-C
$$
etcd_release_tmp_dir
--strip-components
=
1
;
\
cp
$$
etcd_release_tmp_dir/etcd
$$
etcd_release_tmp_dir/etcdctl
$(TEMP_DIR)
/
;
\
cp
$(TEMP_DIR)
/etcd
$(TEMP_DIR)
/etcd-
$$
tag
;
\
cp
$(TEMP_DIR)
/etcdctl
$(TEMP_DIR)
/etcdctl-
$$
tag
;
\
done
else
else
# Download etcd in a golang container and cross-compile it statically
# Download etcd in a golang container and cross-compile it statically
docker run -it -v $(TEMP_DIR)
:
/etcdbin golang:$(GOLANG_VERSION) /bin/bash -c
\
# For each release create a tmp dir 'etcd_release_tmp_dir' and unpack the release tar there.
"git clone https://github.com/coreos/etcd /go/src/github.com/coreos/etcd
\
for
tag
in
$(TAGS);
do
\
&& cd /go/src/github.com/coreos/etcd
\
etcd_release_tmp_dir
=
$(
shell
mktemp
-d
)
;
\
&& git checkout v$(TAG)
\
docker run
-it
-v
$$
etcd_release_tmp_dir:/etcdbin golang:
$(GOLANG_VERSION)
/bin/bash
-c
\
&& GOARM=$(GOARM) GOARCH=$(ARCH) ./build
\
"git clone https://github.com/coreos/etcd /go/src/github.com/coreos/etcd
\
&& cp -f bin/$(ARCH)/etcd* bin/etcd* /etcdbin; echo 'done'"
&& cd /go/src/github.com/coreos/etcd
\
&& git checkout v
$$
tag
\
&& GOARM=
$(GOARM)
GOARCH=
$(ARCH)
./build
\
&& cp -f bin/
$(ARCH)
/etcd* bin/etcd* /etcdbin; echo 'done'"
;
\
cp
$$
etcd_release_tmp_dir/etcd
$$
etcd_release_tmp_dir/etcdctl
$(TEMP_DIR)
/
;
\
cp
$(TEMP_DIR)
/etcd
$(TEMP_DIR)
/etcd-
$$
tag
;
\
cp
$(TEMP_DIR)
/etcdctl
$(TEMP_DIR)
/etcdctl-
$$
tag
;
\
done
# Add this ENV variable in order to workaround an unsupported arch blocker
# Add this ENV variable in order to workaround an unsupported arch blocker
# The multiarch feature is in an limited and experimental state right now, and etcd should work fine on arm64
# The multiarch feature is in an limited and experimental state right now, and etcd should work fine on arm64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment