Skip to content

Instantly share code, notes, and snippets.

@bosunolanrewaju
Forked from 0sc/aws-go+docker-setup.sh
Created March 29, 2018 14:49
Show Gist options
  • Select an option

  • Save bosunolanrewaju/3393e18101d163e42e0b4124bb084672 to your computer and use it in GitHub Desktop.

Select an option

Save bosunolanrewaju/3393e18101d163e42e0b4124bb084672 to your computer and use it in GitHub Desktop.

Revisions

  1. @0sc 0sc revised this gist Oct 21, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ mkdir -p ~/go/bin
    # set necessary go env variables
    cat > ./go-env.sh <<EOL
    export GOPATH=~/go
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
    export PATH=$PATH:/usr/local/go/bin:~/go/bin
    EOL
    chmod +x ./go-env.sh
    sudo mv ./go-env.sh /etc/profile.d/
  2. @0sc 0sc revised this gist Oct 21, 2017. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -21,11 +21,12 @@ sudo tar -C /usr/local -xzf $VERSION
    mkdir -p ~/go/bin

    # set necessary go env variables
    sudo cat > /etc/profile.d/go-env.sh <<EOL
    cat > ./go-env.sh <<EOL
    export GOPATH=~/go
    export PATH=$PATH:$GOPATH/bin
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
    EOL
    sudo chmod +x /etc/profile.d/go-env.sh
    chmod +x ./go-env.sh
    sudo mv ./go-env.sh /etc/profile.d/

    # install git for go get command
    # Docker installation
  3. @0sc 0sc revised this gist Oct 21, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -21,11 +21,11 @@ sudo tar -C /usr/local -xzf $VERSION
    mkdir -p ~/go/bin

    # set necessary go env variables
    cat > /etc/profile.d/go-env.sh <<EOL
    sudo cat > /etc/profile.d/go-env.sh <<EOL
    export GOPATH=~/go
    export PATH=$PATH:$GOPATH/bin
    EOL
    chmod +x /etc/profile.d/go-env.sh
    sudo chmod +x /etc/profile.d/go-env.sh

    # install git for go get command
    # Docker installation
  4. @0sc 0sc revised this gist Oct 21, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -21,8 +21,11 @@ sudo tar -C /usr/local -xzf $VERSION
    mkdir -p ~/go/bin

    # set necessary go env variables
    cat > /etc/profile.d/go-env.sh <<EOL
    export GOPATH=~/go
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
    export PATH=$PATH:$GOPATH/bin
    EOL
    chmod +x /etc/profile.d/go-env.sh

    # install git for go get command
    # Docker installation
  5. @0sc 0sc revised this gist Oct 16, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ cd ~/
    VERSION=go1.9.linux-amd64.tar.gz

    # download the go archive for the specified version
    sudo curl https://storage.googleapis.com/golang/$VERSION
    sudo curl -O https://storage.googleapis.com/golang/$VERSION

    # extract the downloaded archive into the /usr/local folder
    sudo tar -C /usr/local -xzf $VERSION
  6. @0sc 0sc revised this gist Oct 16, 2017. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -25,13 +25,10 @@ export GOPATH=~/go
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

    # install git for go get command
    sudo yum install -y git

    # Docker installation
    # http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html

    # install docker
    sudo yum install -y docker
    sudo yum install -y git docker

    # download the docker compose binary
    curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > ./docker-compose
  7. @0sc 0sc created this gist Oct 16, 2017.
    49 changes: 49 additions & 0 deletions aws-go+docker-setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #!bin/sh

    # Update installed packages and package cache
    sudo yum update -y

    # make sure in the home folder
    cd ~/

    # Golang installation

    # specify go version to install
    VERSION=go1.9.linux-amd64.tar.gz

    # download the go archive for the specified version
    sudo curl https://storage.googleapis.com/golang/$VERSION

    # extract the downloaded archive into the /usr/local folder
    sudo tar -C /usr/local -xzf $VERSION

    # setup the default GOPATH workspace
    mkdir -p ~/go/bin

    # set necessary go env variables
    export GOPATH=~/go
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

    # install git for go get command
    sudo yum install -y git

    # Docker installation
    # http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html

    # install docker
    sudo yum install -y docker

    # download the docker compose binary
    curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > ./docker-compose

    # mv docker-compose binary to usr/bin folder
    sudo mv ./docker-compose /usr/bin/docker-compose

    # make docker-compose binary executable
    sudo chmod +x /usr/bin/docker-compose

    # start the docker service
    sudo service docker start

    # add ec2-user to the docker group to lose the sudo command when using docker
    sudo usermod -a -G docker ec2-user