Skip to content

Instantly share code, notes, and snippets.

View attawayinc's full-sized avatar
💭
I may be slow to respond.

attawayinc

💭
I may be slow to respond.
View GitHub Profile
@attawayinc
attawayinc / Docker_Deploy.md
Created October 3, 2021 18:18 — forked from bradbergeron-us/Docker_Deploy.md
Deploying a Docker Registry

Deploying a registry server

This section explains how to deploy a Docker Registry either privately for your own company or publicly for other users. For example, your company may require a private registry to support your continuous integration (CI) system as it builds new releases or test servers. Alternatively, your company may have a large number of products or services with images you wish to serve in a branded manner.

Docker's public registry maintains a default registry image to assist you in the deployment process. This registry image is sufficient for running local tests but is insufficient for production. For production you should configure and build your own custom registry image from the docker/distribution code.

Note: The examples on this page were written and tested using Ubuntu 14.04. If you are running Docker in a different OS, you may need to "translate" the commands to meet the requirements of your own environment.

###Simple example with the official image In this section, you cre

@attawayinc
attawayinc / docker-examples.md
Created September 24, 2021 20:21 — forked from thaJeztah/docker-examples.md
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@attawayinc
attawayinc / Docker shell commands.sh
Created September 23, 2021 21:39 — forked from bahmutov/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
‎‎​
@attawayinc
attawayinc / docker-machine
Last active February 10, 2021 01:58
docker-machine
# Now, install Docker Machine on your Linux computer with the following command:
base=https://github.com/docker/machine/releases/download/v0.16.0 &&
curl -L $base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
sudo install /tmp/docker-machine /usr/local/bin/docker-machine
# You should install the Docker Machine bash auto completion scripts. To do that, run the following command:
base=https://raw.githubusercontent.com/docker/machine/v0.16.0
for i in docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash
@attawayinc
attawayinc / gitcreate.sh
Created December 3, 2020 02:09 — forked from robwierzbowski/gitcreate.sh
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@attawayinc
attawayinc / fix-wsl2-dns-resolution
Created November 28, 2020 22:29 — forked from coltenkrauter/fix-wsl2-dns-resolution
Fix DNS resolution in WSL2
1. Create a file: /etc/wsl.conf.
2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away
[network]
generateResolvConf = false
3. In a cmd window, run wsl --shutdown
4. Restart WSL2
5. Create a file: /etc/resolv.conf. If it exists, replace existing one with this new file.
6. Put the following line in the file
@attawayinc
attawayinc / install.sh
Created November 25, 2020 21:55 — forked from det-peralta/install.sh
Install NodeJS + GatsbyJS on Windows Subsystem
#NodeJS
sudo apt-get update
sudo apt-get -f install
sudo apt-get install curl
sudo apt-get install build-essential
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
nvm install --lts
nvm use --lts
echo "nvm use --lts" >> .bash_profile

Build your own JAMstack site

Prerequisites

  • npm
  • gatsby-cli
  • gitlab account
  • domain name (purchased through Google Domains)
  • meetup.com page

Build your site

#!/bin/bash
#save as install-k3d.sh
#az vm create -g k3s --image UbuntuLTS --admin-username ubuntu --ssh-key-values ~/.ssh/id_rsa.pub -n k3s --custom-data install-k3d.sh
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1002 --access Allow --protocol Tcp --destination-port-ranges 443 -n https
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1001 --access Allow --protocol Tcp --destination-port-ranges 80 -n http
curl https://get.docker.com/ | sh
sudo usermod -aG docker ubuntu