With Chef you can automatize the creation of your environment with simples scripts.
First you need to install Docker and Docker Compose.
- Update the apt package index:
sudo apt-get update- Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common- Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.
sudo apt-key fingerprint 0EBFCD88- Add the repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"- Install Docker CE
sudo apt-get install docker-ce- Check the current release and if necessary, update it in the command below:
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose- Set the permissions:
sudo chmod +x /usr/local/bin/docker-compose- Verify that the installation was successful by checking the version:
docker-compose --versionFirst you need to create a directory
mkdir chef-trainingAnd, move into the directory
cd ~/try-chefGet the Docker Compose file.
wget https://raw.githubusercontent.com/learn-chef/chef/master/docker-compose.ymlNext, run the following docker-compose command to retrieve the latest workstation images.
docker-compose pullNext, run the following docker-compose command to start the containers. The -d argument starts the containers in the background.
docker-compose up -dNow, start an interactive Bash session on the workstation container.
docker exec -it workstation bash