Skip to content

Commit

Permalink
fix enabling docker cli experimental features in travis env (aws#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner5 committed May 11, 2020
1 parent 2d941c3 commit b647783
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/push-docker-images
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ VERSION=$(make -s -f $MAKE_FILE_PATH version)
PLATFORMS=("linux/amd64")
MANIFEST_IMAGES=""
MANIFEST=""
DOCKER_CLI_CONFIG="$HOME/.docker/config.json"

USAGE=$(cat << 'EOM'
Usage: push-docker-images [-p <platform pairs>]
Expand Down Expand Up @@ -70,10 +71,12 @@ for os_arch in "${PLATFORMS[@]}"; do
done

if [[ $MANIFEST == "true" ]]; then
if [[ $(cat $HOME/.docker/config.json | jq .experimental) != "enabled" ]]; then
perl -i -pe's/experimental\"[ ]*\:[ ]*\"disabled\"/experimental\":\"enabled\"/g' $HOME/.docker/config.json
echo "Enabled experimental CLI features to create the docker manifest"
if [[ ! -f $DOCKER_CLI_CONFIG ]]; then
echo '{"experimental":"enabled"}' > $DOCKER_CLI_CONFIG
echo "Created docker config file"
fi
cat <<< $(jq '.+{"experimental":"enabled"}' $DOCKER_CLI_CONFIG) > $DOCKER_CLI_CONFIG
echo "Enabled experimental CLI features to create the docker manifest"
docker manifest create $IMAGE_REPO:$VERSION $MANIFEST_IMAGES

for os_arch in "${PLATFORMS[@]}"; do
Expand Down

0 comments on commit b647783

Please sign in to comment.