Skip to content

Commit 996138b

Browse files
author
Tibor Vass
committed
Fix release scripts
Add some missing dependencies in the Dockerfile: - apt-utils for apt-ftparchive.conf - bsdmainutils for our use of the column command in hack/make/generate-index-listing We also ensure that the docker daemon is started before calling release-deb or release-rpm, since .detect-daemon-osarch, which is sourced in each of them, requires the daemon to be running. This commit also gets completely rid of s3cmd and fixes references to AWS_* environment variables (changing from AWS_ACCESS_KEY to AWS_ACCESS_KEY_ID and AWS_SECRET_KEY to AWS_SECRET_ACCESS_KEY) in order to please awscli. Also AWS_DEFAULT_REGION is now important to specify, the default has been set to the region used by get.docker.com and test.docker.com. Signed-off-by: Tibor Vass <[email protected]>
1 parent e80f836 commit 996138b

8 files changed

Lines changed: 21 additions & 25 deletions

File tree

Dockerfile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ RUN echo deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main > /etc/apt/s
3838
# Packaged dependencies
3939
RUN apt-get update && apt-get install -y \
4040
apparmor \
41+
apt-utils \
4142
aufs-tools \
4243
automake \
4344
bash-completion \
45+
bsdmainutils \
4446
btrfs-tools \
4547
build-essential \
4648
clang-3.8 \
@@ -64,12 +66,12 @@ RUN apt-get update && apt-get install -y \
6466
python-mock \
6567
python-pip \
6668
python-websocket \
67-
s3cmd=1.5.0* \
6869
ubuntu-zfs \
6970
xfsprogs \
7071
libzfs-dev \
7172
tar \
7273
--no-install-recommends \
74+
&& pip install awscli==1.10.15 \
7375
&& ln -snf /usr/bin/clang-3.8 /usr/local/bin/clang \
7476
&& ln -snf /usr/bin/clang++-3.8 /usr/local/bin/clang++
7577

@@ -187,13 +189,6 @@ RUN git clone https://github.com/docker/docker-py.git /docker-py \
187189
&& git checkout -q $DOCKER_PY_COMMIT \
188190
&& pip install -r test-requirements.txt
189191

190-
# Setup s3cmd config
191-
RUN { \
192-
echo '[default]'; \
193-
echo 'access_key=$AWS_ACCESS_KEY'; \
194-
echo 'secret_key=$AWS_SECRET_KEY'; \
195-
} > ~/.s3cfg
196-
197192
# Set user.email so crosbymichael's in-container merge commits go smoothly
198193
RUN git config --global user.email '[email protected]'
199194

Dockerfile.aarch64

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ RUN git clone https://github.com/docker/docker-py.git /docker-py \
136136
&& git checkout -q $DOCKER_PY_COMMIT \
137137
&& pip install -r test-requirements.txt
138138

139-
# Setup s3cmd config
140-
RUN { \
141-
echo '[default]'; \
142-
echo 'access_key=$AWS_ACCESS_KEY'; \
143-
echo 'secret_key=$AWS_SECRET_KEY'; \
144-
} > ~/.s3cfg
145-
146139
# Set user.email so crosbymichael's in-container merge commits go smoothly
147140
RUN git config --global user.email '[email protected]'
148141

hack/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -e
2020
# To update this script on https://get.docker.com,
2121
# use hack/release.sh during a normal release,
2222
# or the following one-liner for script hotfixes:
23-
# s3cmd put --acl-public -P hack/install.sh s3://get.docker.com/index
23+
# aws s3 cp --acl public-read hack/install.sh s3://get.docker.com/index
2424
#
2525

2626
url="https://get.docker.com/"

hack/make/.integration-daemon-start

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ if ! command -v docker &> /dev/null; then
99
false
1010
fi
1111

12+
if [ -z "$DOCKER_TEST_HOST" ]; then
13+
if docker version &> /dev/null; then
14+
echo >&2 'skipping daemon start, since daemon appears to be already started'
15+
return
16+
fi
17+
fi
18+
1219
# intentionally open a couple bogus file descriptors to help test that they get scrubbed in containers
1320
exec 41>&1 42>&2
1421

hack/make/release-deb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set -e
1414
#
1515
# ... and so on and so forth for the builds created by hack/make/build-deb
1616

17+
source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
1718
source "$(dirname "$BASH_SOURCE")/.detect-daemon-osarch"
1819

1920
: ${DOCKER_RELEASE_DIR:=$DEST}

hack/make/release-rpm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set -e
1414
#
1515
# ... and so on and so forth for the builds created by hack/make/build-rpm
1616

17+
source "$(dirname "$BASH_SOURCE")/.integration-daemon-start"
1718
source "$(dirname "$BASH_SOURCE")/.detect-daemon-osarch"
1819

1920
: ${DOCKER_RELEASE_DIR:=$DEST}

hack/release.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cd /go/src/github.com/docker/docker
4343
[ -x hack/make.sh ] || usage
4444

4545
export AWS_DEFAULT_REGION
46-
: ${AWS_DEFAULT_REGION:=us-west-2}
46+
: ${AWS_DEFAULT_REGION:=us-west-1}
4747

4848
RELEASE_BUNDLES=(
4949
binary
@@ -79,8 +79,6 @@ fi
7979

8080
setup_s3() {
8181
echo "Setting up S3"
82-
# TODO: Move to Dockerfile
83-
pip install awscli==1.10.15
8482
# Try creating the bucket. Ignore errors (it might already exist).
8583
aws s3 mb "s3://$BUCKET" 2>/dev/null || true
8684
# Check access to the bucket.
@@ -104,8 +102,7 @@ s3_url() {
104102
echo "https://$BUCKET_PATH"
105103
;;
106104
*)
107-
# TODO: remove s3cmd dependency
108-
BASE_URL=$( s3cmd ws-info s3://$BUCKET | awk -v 'FS=: +' '/http:\/\/'$BUCKET'/ { gsub(/\/+$/, "", $2); print $2 }' )
105+
BASE_URL="http://${BUCKET}.s3-website-${AWS_DEFAULT_REGION}.amazonaws.com"
109106
if [[ -n "$AWS_S3_BUCKET_PATH" ]] ; then
110107
echo "$BASE_URL/$AWS_S3_BUCKET_PATH"
111108
else

project/RELEASE-CHECKLIST.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,9 @@ docker build -t docker .
270270
# static binaries are still pushed to s3
271271
docker run \
272272
-e AWS_S3_BUCKET=test.docker.com \
273-
-e AWS_ACCESS_KEY \
274-
-e AWS_SECRET_KEY \
273+
-e AWS_ACCESS_KEY_ID \
274+
-e AWS_SECRET_ACCESS_KEY \
275+
-e AWS_DEFAULT_REGION \
275276
-i -t --privileged \
276277
docker \
277278
hack/release.sh
@@ -434,8 +435,9 @@ docker build -t docker .
434435
# static binaries are still pushed to s3
435436
docker run \
436437
-e AWS_S3_BUCKET=get.docker.com \
437-
-e AWS_ACCESS_KEY \
438-
-e AWS_SECRET_KEY \
438+
-e AWS_ACCESS_KEY_ID \
439+
-e AWS_SECRET_ACCESS_KEY \
440+
-e AWS_DEFAULT_REGION \
439441
-i -t --privileged \
440442
docker \
441443
hack/release.sh

0 commit comments

Comments
 (0)