-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-docker.yml
34 lines (28 loc) · 1 KB
/
build-docker.yml
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
---
- name: Build a Alpine Linux docker image with nginx
hosts: bp
become: true
tasks:
- name: copy the Dockerfile and ngnix config files to remote host
copy:
src: ./HelloWorld
dest: /tmp/
mode: 0755
# - name: Build the Alpine Linux docker image with nginx
# docker_image:
# path: /tmp/HelloWorld
# name: somename
# tag: v1
# state: present
# THIS FAILS with:
#
# TASK [Build the Alpine Linux docker image with nginx] **************************
# fatal: [bp-test]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to import docker-py - No module named requests.exceptions. Try `pip install docker-py`"}
#
# Lots of bugs are reported.
- name: Build the Alpine Linux docker image with nginx using the command module
command: docker build -t virantha-alpine-nginx /tmp/HelloWorld
- name: do some cleanup. delete /tmp/HelloWorld
file:
state: absent
path: "/tmp/HelloWorld"