-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_docker.yaml
More file actions
80 lines (69 loc) · 1.71 KB
/
Copy pathdeploy_docker.yaml
File metadata and controls
80 lines (69 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
- hosts: installinghost
# Port variable
# --
#
# TODO: Set the port_number to your desired port.
#
vars:
port_number: 3000
become: yes
tasks:
# Install Docker
# --
#
# TODO: Make sure you replace user vagrant with your desired administrative
# username for your remote server!
#
- name: install prerequisites
apt:
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
update_cache: yes
- name: add apt-key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
- name: add docker repo
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
- name: install docker
apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
update_cache: yes
- name: add userpermissions
shell: "usermod -aG docker vagrant"
# Installs Docker SDK
# --
#
# TODO: Make sure you replace user vagrant with your desired administrative
# username for your remote server!
#
- name: install python package manager
apt:
name: python-pip
- name: install python sdk
become_user: vagrant
pip:
name:
- docker
- docker-compose
# Pulls the Docker Tutorial
# --
#
# TODO: Make sure you replace the repository with the one you want
# to deploy!
#
# This docker repository is avaivable for public here:
# https://hub.docker.com/r/mark141/getting-started
#
- name: docker pull
shell: "docker pull mark141/getting-started"
- name: deploy docker
shell: "docker run -dp {{port_number}}:{{port_number}} mark141/getting-started"