To compile code into assets/artifacts and build a Docker image with the resulting code only, and no compilers/devel packages/libraries, you have a workflow like so:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Found on Reddit - cannot now remember where | |
| # Modified by Chris Collins to suite his tastes | |
| git rev-parse 2> /dev/null && git status --porcelain -b | awk ' | |
| /^## / { | |
| branch = $0; | |
| sub(/^## /, "", branch); | |
| sub(/\.\.\..*/, "", branch); | |
| if ($0 ~ /ahead /) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| usage () { | |
| cat << EOF | |
| Usage: dkr HOSTNAME | |
| dkr HOSTNAME COMMAND [arg...] | |
| A wrapper around Docker to simplify using TLS connections | |
| In the first form, will watch the output of "docker ps" and "docker images" on the remote host. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| ## Snippet of Ansible Playbook for auto-expanding a volume group based on disks on the server | |
| ### Format Partitions ### | |
| - name: Format | find disks | |
| command: find /dev -regex "/dev/sd[b-z]" -exec echo "{}," \; | |
| register: extra_pvs | |
| - name: Format | expand vg if extra_pvs exist | |
| # defaultpv comes last, because extra_pvs are formatted to have a comma on the end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script that can be run to cleanup a Jenkins slave server that's used to build docker images | |
| # Tries to account for the fact that a job might be running and using images & containers | |
| # Adjust the Docker command to match your environment (esp. the $HOST hostname) | |
| # TLS included as script it designed to be run from the master | |
| DOCKER_TLS_VERIFY=1 | |
| DOCKER="docker --tlscacert /ca.pem --tlscert /cert.pem --tlskey /key.pem -H ${HOST}" | |
| RUNNING_CONTAINERS=$($DOCKER ps -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| systemctl enable <path-to-mountpoint>.automount | |
| systemctl start <path-to-mountpoint>.automount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| error () { | |
| local msg="${1}" | |
| echo "${msg}" | |
| exit 1 | |
| } | |
| make_tempdir () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Set to true to just see what command | |
| # would be run | |
| DRY_RUN=false | |
| TITLE='MY-TEST-CONTAINER' | |
| IMAGE='MY-IMAGE' | |
| # Local volume to be mapped into the container any time you run it | |
| # usually with config files or whatnot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # TODO: | |
| # How to handle NOT running the DB upgrade if it's not needed? | |
| HOSTNAME="$(/bin/hostname)" | |
| TMPDIR='/tmp' | |
| MAILFROM="patch.adams@$HOSTNAME" | |
| MAILTO="$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Version 1.2 - 2015-01-07 | |
| # https://gist.github.com/clcollins/cfab1f63dc1aa927bf9f | |
| # REQUIRES: | |
| # | |
| # Software - | |
| # 1. Docker: https://docker.com | |
| # |