Skip to content

Instantly share code, notes, and snippets.

@davetron5000
Created July 16, 2023 15:27
Show Gist options
  • Save davetron5000/0138dadc84ec4d5772f231f5dd9b0b7e to your computer and use it in GitHub Desktop.
Save davetron5000/0138dadc84ec4d5772f231f5dd9b0b7e to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. ${SCRIPT_DIR}/setupkit.sh.lib
. ${SCRIPT_DIR}/dx.sh.lib
usage_on_help "Builds the Docker image based on the Dockerfile" "" ${@}
ensure_docker_compose_env
# CODE=$(realpath ${SCRIPT_DIR}/../../dcsidekiq/Book/code/)
# DEV_ENV=$(realpath ${CODE}/dev-environment/)
# SNAPSHOTS=$(realpath ${CODE}/snapshots/0-0/)
# log "๐Ÿ”„" "Re-syncing dev-environment to ${DEV_ENV}"
# mkdir -p ${DEV_ENV}
# rsync -l --exclude='/sidekiq-book/node_modules' --exclude='/sidekiq-book/tmp' --exclude='/sidekiq-book/.git' --exclude='/.git' --exclude='/.gitignore' --exclude='/sidekiq-book/log' --delete -r . ${DEV_ENV}
#
# log "๐Ÿ”„" "Re-syncing base snapshot to ${SNAPSHOTS}"
# mkdir -p ${SNAPSHOTS}
# rm -rf ${SNAPSHOTS}/sidekiq-book
# rsync -l --exclude='/sidekiq-book/node_modules' --exclude='/sidekiq-book/tmp' --exclude='/sidekiq-book/.git' --exclude='/sidekiq-book/log' --delete -r sidekiq-book ${SNAPSHOTS}
log "๐Ÿ›ณ" "Building Docker image from Dockerfile.dx"
docker build -f Dockerfile.dx -t $IMAGE ./
log "๐ŸŒˆ" "Your Docker image has been built tagged '${IMAGE}'"
log "๐Ÿ”„" "You can now run dx/start to start it up, though you may need to stop it first with Ctrl-C"
# vim: ft=bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment