Created
March 29, 2020 04:43
-
-
Save pavan168/15c788d6936b39025328a7e7be971838 to your computer and use it in GitHub Desktop.
A script file to setup the new instance environment with Docker, Build the new image, and Export
This file contains 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 | |
projectfolder=$1 | |
# setup docker environment | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable edge" | |
sudo apt-get update | |
sudo apt-get install docker-ce docker-ce-cli -y | |
sudo docker -v | |
# setup project and build | |
cd /home/ubuntu/$projectfolder | |
sudo docker build -t $projectfolder . | |
sudo docker save -o /home/ubuntu/$projectfolder.tar $projectfolder | |
sudo chown ubuntu:ubuntu /home/ubuntu/$projectfolder.tar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment