Sha256: 795d0504c0f21c33efb8fad087c30dfe1561185dcd0ad5ce82decb6260b9d0ee

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

#!/bin/bash -e

IMAGE="cyberark/conjur-cli:latest"

ENV_VARS=(
  "CONJUR_MAJOR_VERSION=5"
  "CONJUR_VERSION=5"
  "PATH=/usr/local/lib/summon:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
)

# Flatten resulting image.
flatten() {
  local image="$1"
  echo "Flattening image '$image'..."

  # Since `--squash` is still experimental, we have to flatten the image
  # by exporting and importing a container based on the source image. By
  # doing this though, we lose a lot of the Dockerfile variables that are
  # required for running the image (ENV, EXPOSE, WORKDIR, etc) so we
  # manually rebuild them.
  # See here for more details: https://github.com/moby/moby/issues/8334
  local container
  container=$(docker create "$image")

  env_var_params=()
  for env_var in "${ENV_VARS[@]}"; do
    env_var_params+=("--change")
    env_var_params+=("ENV $env_var")
  done

  docker export "$container" | docker import \
    "${env_var_params[@]}" \
    --change 'ENTRYPOINT ["/bin/entry"]' \
    - "$image"
  docker rm "$container"
}

# Build the cli standalone container image
echo "Building image $IMAGE"

docker build . \
       --file Dockerfile.standalone \
       --tag "$IMAGE"

flatten "$IMAGE"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
conjur-cli-6.2.6 build-standalone
conjur-cli-6.2.5 build-standalone
conjur-cli-6.2.4 build-standalone
conjur-cli-6.2.3 build-standalone