Added new README
This commit is contained in:
123
.gitignore
vendored
123
.gitignore
vendored
@@ -1,14 +1,107 @@
|
|||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/macos,vagrant,visualstudiocode,intellij+all,ansible
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,vagrant,visualstudiocode,intellij+all,ansible
|
||||||
|
|
||||||
# Created by https://www.gitignore.io/api/macos,vagrant,visualstudiocode
|
### Ansible ###
|
||||||
|
*.retry
|
||||||
|
|
||||||
|
### Intellij+all ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# AWS User-specific
|
||||||
|
.idea/**/aws.xml
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/artifacts
|
||||||
|
# .idea/compiler.xml
|
||||||
|
# .idea/jarRepositories.xml
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# SonarLint plugin
|
||||||
|
.idea/sonarlint/
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
### Intellij+all Patch ###
|
||||||
|
# Ignore everything but code style settings and run configurations
|
||||||
|
# that are supposed to be shared within teams.
|
||||||
|
|
||||||
|
.idea/*
|
||||||
|
|
||||||
|
!.idea/codeStyles
|
||||||
|
!.idea/runConfigurations
|
||||||
|
|
||||||
### macOS ###
|
### macOS ###
|
||||||
*.DS_Store
|
# General
|
||||||
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
.LSOverride
|
.LSOverride
|
||||||
|
|
||||||
# Icon must end with two \r
|
# Icon must end with two \r
|
||||||
Icon
|
Icon
|
||||||
|
|
||||||
|
|
||||||
# Thumbnails
|
# Thumbnails
|
||||||
._*
|
._*
|
||||||
|
|
||||||
@@ -28,8 +121,18 @@ Network Trash Folder
|
|||||||
Temporary Items
|
Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
|
|
||||||
|
### macOS Patch ###
|
||||||
|
# iCloud generated files
|
||||||
|
*.icloud
|
||||||
|
|
||||||
### Vagrant ###
|
### Vagrant ###
|
||||||
|
# General
|
||||||
.vagrant/
|
.vagrant/
|
||||||
|
|
||||||
|
# Log files (if you are creating logs in debug mode, uncomment this)
|
||||||
|
# *.log
|
||||||
|
|
||||||
|
### Vagrant Patch ###
|
||||||
*.box
|
*.box
|
||||||
|
|
||||||
### VisualStudioCode ###
|
### VisualStudioCode ###
|
||||||
@@ -38,9 +141,17 @@ Temporary Items
|
|||||||
!.vscode/tasks.json
|
!.vscode/tasks.json
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
|
### VisualStudioCode Patch ###
|
||||||
|
# Ignore all local history of files
|
||||||
.history
|
.history
|
||||||
|
.ionide
|
||||||
|
|
||||||
### Ansible ###
|
# End of https://www.toptal.com/developers/gitignore/api/macos,vagrant,visualstudiocode,intellij+all,ansible
|
||||||
*.retry
|
|
||||||
|
|
||||||
# End of https://www.gitignore.io/api/macos,vagrant,visualstudiocode,ansible
|
|
||||||
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -1,6 +1,6 @@
|
|||||||
Vagrant.configure(2) do |config|
|
Vagrant.configure(2) do |config|
|
||||||
config.vm.define "docker" do |docker|
|
config.vm.define "docker" do |docker|
|
||||||
docker.vm.box = "bento/ubuntu-18.04"
|
docker.vm.box = "bento/ubuntu-24.04"
|
||||||
docker.vm.network "private_network", ip: "192.168.11.22"
|
docker.vm.network "private_network", ip: "192.168.11.22"
|
||||||
docker.vm.hostname = "docker"
|
docker.vm.hostname = "docker"
|
||||||
docker.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
|
docker.vm.synced_folder ".", "/home/vagrant/sync", type: "rsync"
|
||||||
|
|||||||
101
compose/README.md
Normal file
101
compose/README.md
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
[](http://www.agile611.com/)
|
||||||
|
|
||||||
|
# Start Using Docker
|
||||||
|
|
||||||
|
Here is an explanation of the architecture to be used in the training.
|
||||||
|
|
||||||
|
This is an academic setup; it is not intended to be a production environment.
|
||||||
|
|
||||||
|
## Working Repository
|
||||||
|
|
||||||
|
Attached is the work repository we will use during the course:
|
||||||
|
|
||||||
|
[Start Using Docker](https://bitbucket.org/agile611/startusingdocker)
|
||||||
|
|
||||||
|
For the training sessions, computers will be needed, either laptops or desktops.
|
||||||
|
|
||||||
|
## Installation for Local Development
|
||||||
|
|
||||||
|
We need to install these 3 applications on our machines:
|
||||||
|
|
||||||
|
- [GIT](https://git-scm.com/downloads)
|
||||||
|
- [Vagrant](https://www.vagrantup.com/downloads.html)
|
||||||
|
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
|
||||||
|
|
||||||
|
Vagrant fetches virtual machines from remote repositories, so we advise disconnecting any VPN connections on your machine.
|
||||||
|
|
||||||
|
### Setting Up the Environment
|
||||||
|
|
||||||
|
To download the repository, you need to download the code:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://bitbucket.org/agile611/startusingdocker.git
|
||||||
|
cd startusingdocker
|
||||||
|
```
|
||||||
|
|
||||||
|
From the folder `startusingdocker`, use the following command to set up an Ubuntu 24.04 VM (from now on, the Box):
|
||||||
|
|
||||||
|
```shell
|
||||||
|
vagrant up
|
||||||
|
```
|
||||||
|
Then, to access the Box, connect via SSH using the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
vagrant ssh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Potential Problems Provisioning the Box
|
||||||
|
|
||||||
|
If you have problems provisioning the Box, you can download it directly from [here](https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-24.04) depending on your architecture.
|
||||||
|
|
||||||
|
Then, you need to know the path of the Box and execute the following commands:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
vagrant box add /The/Path/From/Your/Downloaded/box/bento-ubuntu-24-04.box --name bento/ubuntu-24.04
|
||||||
|
vagrant init bento/ubuntu-24.04
|
||||||
|
```
|
||||||
|
|
||||||
|
The `init` command creates a VagrantFile with your initial configuration. In the same folder where this Vagrantfile is located, please execute the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
vagrant up
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, connect to the Box using the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
vagrant ssh
|
||||||
|
```
|
||||||
|
|
||||||
|
If you get a terminal from the Box, your environment is ready.
|
||||||
|
|
||||||
|
### Common Networking Problems
|
||||||
|
|
||||||
|
If you have proxies or VPNs running on your machine, it is possible that Vagrant is not able to provision your environment. Please check your connectivity beforehand.
|
||||||
|
|
||||||
|
### Virtualization with VirtualBox
|
||||||
|
|
||||||
|
It is important to ensure that you can virtualize with VirtualBox. If you cannot, you may need to enable VT-X in your machine's BIOS. Here is how to enable it in the BIOS: [How to enable Intel VT-X and AMD SVM in the BIOS](https://www.qnap.com/en/how-to/faq/article/how-to-enable-intel-vt-x-and-amd-svm/)
|
||||||
|
|
||||||
|
### Vagrant Installation Videos
|
||||||
|
|
||||||
|
Here are videos on how to install Vagrant on different platforms:
|
||||||
|
- [Windows](https://www.youtube.com/watch?v=mPBWWu7sZU4)
|
||||||
|
- [MacOS](https://www.youtube.com/watch?v=kCVsWyR8mbo)
|
||||||
|
- [Linux](https://www.youtube.com/watch?v=yGviTwD3hWM)
|
||||||
|
|
||||||
|
To run all this setup, you need to have Git, Vagrant, and VirtualBox installed on your machine.
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
This tutorial is released into the public domain by [Agile611](http://www.agile611.com/) under the Creative Commons Attribution-NonCommercial 4.0 International license.
|
||||||
|
|
||||||
|
[](https://creativecommons.org/licenses/by-nc/4.0/)
|
||||||
|
|
||||||
|
This README file was originally written by [Guillem Hernández Sola](https://www.linkedin.com/in/guillemhs/) and is likewise released into the public domain.
|
||||||
|
|
||||||
|
Please contact Agile611 for further details.
|
||||||
|
|
||||||
|
* [Agile611](http://www.agile611.com/)
|
||||||
|
* Carrer Laureà Miró 309
|
||||||
|
* 08950 Esplugues de Llobregat (Barcelona)
|
||||||
36
docker.sh
36
docker.sh
@@ -1,25 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
apt-transport-https \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
software-properties-common \
|
|
||||||
python-minimal zip python-simplejson \
|
|
||||||
gnupg2 \
|
|
||||||
software-properties-common
|
|
||||||
apt-get remove docker docker-engine docker.io
|
|
||||||
|
|
||||||
curl -fsSL get.docker.com -o get-docker.sh
|
# Add Docker's official GPG key:
|
||||||
sh get-docker.sh
|
apt-get update
|
||||||
|
apt-get install ca-certificates curl
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
# install docker-compose
|
# Add the repository to Apt sources:
|
||||||
curl -L "https://github.com/docker/compose/releases/download/2.30.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
# Install Docker latest version
|
||||||
|
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||||
|
|
||||||
|
# Install docker-compose
|
||||||
|
curl -L "https://github.com/docker/compose/releases/download/v2.35.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
||||||
chmod +x /usr/local/bin/docker-compose
|
chmod +x /usr/local/bin/docker-compose
|
||||||
|
|
||||||
# install docker-machine
|
# Add vagrant user to docker group
|
||||||
curl -L "https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-machine && \
|
|
||||||
chmod +x /usr/local/bin/docker-machine
|
|
||||||
|
|
||||||
usermod -G docker vagrant
|
usermod -G docker vagrant
|
||||||
@@ -1,21 +1,27 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
apt-transport-https \
|
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
software-properties-common \
|
|
||||||
python-minimal zip python-simplejson \
|
|
||||||
gnupg2 \
|
|
||||||
software-properties-common
|
|
||||||
apt-get remove docker docker-engine docker.io
|
|
||||||
|
|
||||||
curl -fsSL get.docker.com -o get-docker.sh
|
# Add Docker's official GPG key:
|
||||||
sh get-docker.sh
|
apt-get update
|
||||||
|
apt-get install ca-certificates curl
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
# install docker-compose
|
# Add the repository to Apt sources:
|
||||||
curl -L "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
# Install Docker latest version
|
||||||
|
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||||
|
|
||||||
|
# Install docker-compose
|
||||||
|
curl -L "https://github.com/docker/compose/releases/download/v2.35.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
|
||||||
chmod +x /usr/local/bin/docker-compose
|
chmod +x /usr/local/bin/docker-compose
|
||||||
|
|
||||||
|
# Add vagrant user to docker group
|
||||||
usermod -G docker vagrant
|
usermod -G docker vagrant
|
||||||
|
|||||||
Reference in New Issue
Block a user