Example of a Docker bind mount.
Create an example directory and copy the following script to it. Make it executable and then run it.
$ chmod +x demo.sh
$ ./demo.sh
.
.
.
| #!/bin/bash | |
| ### Variáveis | |
| PROGRAMAS_APT=( | |
| git | |
| git-flow | |
| google-chrome-stable | |
| deepin-terminal | |
| deepin-screen-recorder | |
| gnome-tweak-tool |
| Segue a lista de comandos docker e sua utilidade: | |
| docker attach – Acessar dentro do container e trabalhar a partir dele. | |
| docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem. | |
| docker commit – Cria uma imagem a partir de um container. | |
| docker cp – Copia arquivos ou diretórios do container para o host. | |
| docker create – Cria um novo container. | |
| docker diff – Exibe as alterações feitas no filesystem do container. | |
| docker events – Exibe os eventos do container em tempo real. | |
| docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele. |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "jacksonpires/ubuntu-rails-dev" | |
| config.vm.box_version = "1.0.0" | |
| config.vm.network :forwarded_port, guest: 3000, host: 3000 # rails | |
| config.vm.network :forwarded_port, guest: 9292, host: 9292 # rack | |
| config.vm.network :forwarded_port, guest: 4567, host: 4567 # sinatra |
| require 'rubygems' | |
| require 'pry' | |
| if defined?(Rails) && Rails.env | |
| if defined?(Rails::ConsoleMethods) | |
| include Rails::ConsoleMethods | |
| else | |
| def reload!(print=true) | |
| puts "Reloading..." if print | |
| ActionDispatch::Reloader.cleanup! |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "jesherpinkman/Centos7" | |
| config.vm.network "forwarded_port", guest: 80, host: 8089 | |
| config.vm.network "public_network", bridge: "wlp2s0" | |
| config.vm.provision "shell", inline: <<-SHELL | |
| sudo curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo | |
| sudo yum update -y | |
| programas=( epel-release | |
| nginx |
| #!/usr/bin/env bash | |
| # Include 'os-release' to grab OS pretty name... | |
| . /etc/os-release | |
| # Styles... | |
| red="$(tput setaf 1)" | |
| bold="$(tput bold)" |
Example of a Docker bind mount.
Create an example directory and copy the following script to it. Make it executable and then run it.
$ chmod +x demo.sh
$ ./demo.sh
.
.
.
| # will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904 | |
| function jwt-decode() { | |
| sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq | |
| } | |
| JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ | |
| jwt-decode $JWT |
| ## Please check out your ssh configurations for connections hosts | |
| [MyServers] | |
| ubuntu ansible_host=< SERVER_IP > | |
| oracle-linux ansible_host=< SERVER_IP > | |
| [all:vars] | |
| ansible_python_interpreter=/usr/bin/python3 |