|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +###################################################################### |
| 4 | +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # |
| 5 | +# SPDX-License-Identifier: Apache-2.0 # |
| 6 | +###################################################################### |
| 7 | + |
| 8 | +# Source helper functions |
| 9 | +source .fun |
| 10 | + |
| 11 | +# Proxy settings [optional] - set if your network requires a proxy to connect to the Internet |
| 12 | +export http_proxy= |
| 13 | +export https_proxy= |
| 14 | +export no_proxy=localhost |
| 15 | + |
| 16 | +# Docker image settings |
| 17 | +## REGISTRY: [optional] - Docker registry path including trailing "/". Example: registry.company.com/demo/ |
| 18 | +export REGISTRY=594704452476.dkr.ecr.us-west-2.amazonaws.com/ |
| 19 | +if [ -n "${REGISTRY}" ]; then |
| 20 | + if [ "${REGISTRY: -1}" != "/" ]; then |
| 21 | + export REGISTRY="${REGISTRY}/" |
| 22 | + fi |
| 23 | +fi |
| 24 | +## IMAGE: <required> - Docker image name for this project. Example: myapp |
| 25 | +export IMAGE=aws-do-cli |
| 26 | +## VERSION: [optional] - Version tag for this Docker image. Example: v20180302 |
| 27 | +#export VERSION=v$(date +%Y%m%d) |
| 28 | +export VERSION=latest |
| 29 | +export TAG=$(if [ -z "${VERSION}" ]; then echo ""; else echo ":${VERSION}"; fi) |
| 30 | +## BUILD_OPTS: [optional] - arguments for the docker image build command |
| 31 | +export BUILD_OPTS="--progress=plain --build-arg http_proxy=${http_proxy} --build-arg https_proxy=${https_proxy} --build-arg no_proxy=${no_proxy}" |
| 32 | + |
| 33 | +# Docker container runtime settings |
| 34 | +## CONTAINER_NAME: [optional] - Name of the Docker container including the --name switch. Example --name myapp |
| 35 | +export CONTAINER=${IMAGE} |
| 36 | +export CONTAINER_NAME="--name ${CONTAINER}" |
| 37 | +## Port map [optional] - Mapping of external to internal ports including the -p switch. Example -p 80:8080 |
| 38 | +#export PORT_MAP="-p 80:8080" |
| 39 | +## Volume map [optional] - Mapping of external to internal paths including the -v switch. Example $(pwd):/wd |
| 40 | +export VOL_MAP="-v ${HOME}/.aws:/root/.aws -v $(pwd):/wd" |
| 41 | +## Network [optional] - Network name including the --net switch. Example --net mynet |
| 42 | +export NETWORK= |
| 43 | +## RUN_OPTS [optional] - additional options to specify with the run comman. Example -e POSTGRES_DB=dbname |
| 44 | +export RUN_OPTS="-e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy" |
| 45 | + |
0 commit comments