Skip to content

Instantly share code, notes, and snippets.

@mauricios
Last active March 8, 2021 20:50
Show Gist options
  • Save mauricios/1c4f06fba31c580133f91fc5d59406b1 to your computer and use it in GitHub Desktop.
Save mauricios/1c4f06fba31c580133f91fc5d59406b1 to your computer and use it in GitHub Desktop.

Install Docker

Downaload the makefile and execute the following command in the same directory

make

# Initial variables
os ?= $(shell uname -s)
requirements: ## 📦 Installing local requirements
ifeq ($(os), Darwin)
grep -q 'brew' <<< echo `command -v brew` || /usr/bin/ruby -e "`curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install`"
brew install make git
brew cask install docker
open -a Docker
else ifeq ($(os), Linux)
sudo sh -c "$$(curl -fsSL https://get.docker.com)"
sudo apt-get install make git
sudo usermod -aG docker $${USER}
sudo service docker start
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(os)-$(shell uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
su - $${USER}
else ifeq ($(os), Windows_NT)
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install make git docker-for-windows -y
else
$(warning Platform "$(os)" not supported)
endif
.DEFAULT_GOAL := requirements
.PHONY: all $(MAKECMDGOALS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment