aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra/pxe/build.sh
blob: bd28a4227f4eb622b7bac4ef7bbb8707b7d63f45 (plain)
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
#!/bin/bash

# Clean.
docker container rm --force pxe-dnsmasq
docker image rm pxe-dnsmasq
docker container rm --force pxe-nginx
docker image rm pxe-nginx

# Build.
docker build \
    --network host \
    --build-arg HTTP_PROXY="$http_proxy" \
    --build-arg HTTPS_PROXY="$http_proxy" \
    --build-arg NO_PROXY="$no_proxy" \
    --build-arg http_proxy="$http_proxy" \
    --build-arg https_proxy="$http_proxy" \
    --build-arg no_proxy="$no_proxy" \
    --tag pxe-dnsmasq docker-dnsmasq/.

docker build \
    --build-arg HTTP_PROXY="$http_proxy" \
    --build-arg HTTPS_PROXY="$http_proxy" \
    --build-arg NO_PROXY="$no_proxy" \
    --build-arg http_proxy="$http_proxy" \
    --build-arg https_proxy="$http_proxy" \
    --build-arg no_proxy="$no_proxy" \
    --tag pxe-nginx docker-nginx/.

# Run.
docker run \
    --rm \
    --detach \
    --publish 8081:80 \
    --name pxe-nginx \
    pxe-nginx

docker run \
    --rm \
    --detach \
    --net host \
    --name pxe-dnsmasq \
    --env "E_INT=$(ip -o -4 route show to default | awk '{print $5}')" \
    --env "E_ADD=$(hostname -I | awk '{print $1}')" \
    --cap-add NET_ADMIN \
    pxe-dnsmasq