haproxy_sous_docker
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| haproxy_sous_docker [2018/11/18 13:10] – simon | haproxy_sous_docker [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Configuration et utilisation d' | ||
| - | |||
| - | On crée un fichier '' | ||
| - | <code bash> | ||
| - | $ ls -al | ||
| - | total 16 | ||
| - | drwxrwxr-x 2 simon simon 4096 Nov 18 10:07 . | ||
| - | drwxr-xr-x 5 simon simon 4096 Nov 18 09:44 .. | ||
| - | -rw-rw-r-- 1 simon simon 185 Nov 18 09:52 Dockerfile | ||
| - | -rw-rw-r-- 1 simon simon 532 Nov 18 10:07 haproxy.cfg | ||
| - | </ | ||
| - | |||
| - | Le '' | ||
| - | <code bash> | ||
| - | FROM haproxy: | ||
| - | COPY haproxy.cfg / | ||
| - | |||
| - | LABEL version=" | ||
| - | LABEL type=" | ||
| - | |||
| - | EXPOSE 80/tcp | ||
| - | EXPOSE 80/udp | ||
| - | EXPOSE 443/tcp | ||
| - | EXPOSE 443/udp | ||
| - | EXPOSE 8080/tcp | ||
| - | </ | ||
| - | |||
| - | La configuration '' | ||
| - | <code bash> | ||
| - | global | ||
| - | daemon | ||
| - | maxconn 4096 | ||
| - | |||
| - | defaults | ||
| - | mode http | ||
| - | timeout connect 5000ms | ||
| - | timeout client 50000ms | ||
| - | timeout server 50000ms | ||
| - | |||
| - | frontend http-in | ||
| - | bind *:80 | ||
| - | acl is_site1 hdr_end(host) -i domain1.se | ||
| - | acl is_site2 hdr_end(host) -i domain2.com | ||
| - | |||
| - | use_backend site1 if is_site1 | ||
| - | use_backend site2 if is_site2 | ||
| - | |||
| - | backend site1 | ||
| - | option httpclose | ||
| - | option forwardfor | ||
| - | server s1 127.0.0.1: | ||
| - | |||
| - | backend site2 | ||
| - | option httpclose | ||
| - | option forwardfor | ||
| - | server s2 127.0.0.1: | ||
| - | |||
| - | listen admin | ||
| - | bind *:8080 | ||
| - | stats enable | ||
| - | </ | ||
| - | |||
| - | On lance la génération de l' | ||
| - | <code bash> | ||
| - | $ docker build -t haproxy . | ||
| - | </ | ||
| - | < | ||
| - | <code bash> | ||
| - | free(): invalid pointer | ||
| - | SIGABRT: abort | ||
| - | PC=0xb6d1e206 m=0 sigcode=4294967290 | ||
| - | signal arrived during cgo execution | ||
| - | |||
| - | goroutine 1 [syscall, locked to thread]: | ||
| - | runtime.cgocall(0xaec2c, | ||
| - | / | ||
| - | github.com/ | ||
| - | github.com/ | ||
| - | github.com/ | ||
| - | / | ||
| - | github.com/ | ||
| - | / | ||
| - | github.com/ | ||
| - | < | ||
| - | github.com/ | ||
| - | / | ||
| - | github.com/ | ||
| - | / | ||
| - | github.com/ | ||
| - | / | ||
| - | main.main() | ||
| - | / | ||
| - | runtime.main() | ||
| - | / | ||
| - | runtime.goexit() | ||
| - | / | ||
| - | |||
| - | goroutine 17 [syscall, locked to thread]: | ||
| - | runtime.goexit() | ||
| - | / | ||
| - | |||
| - | trap 0x6 | ||
| - | error 0x0 | ||
| - | oldmask 0x0 | ||
| - | r0 0x0 | ||
| - | r1 0xbecbc19c | ||
| - | r2 0x0 | ||
| - | r3 0x8 | ||
| - | r4 0x0 | ||
| - | r5 0xb6fb1968 | ||
| - | r6 0xbecbc19c | ||
| - | r7 0xaf | ||
| - | r8 0xbecbc3e8 | ||
| - | r9 0x2 | ||
| - | r10 | ||
| - | fp 0x1 | ||
| - | ip 0xaf | ||
| - | sp 0xbecbc190 | ||
| - | lr 0xb6d2bb33 | ||
| - | pc 0xb6d1e206 | ||
| - | cpsr 0x70030 | ||
| - | fault 0x0 | ||
| - | Sending build context to Docker daemon | ||
| - | Step 1/9 : FROM haproxy: | ||
| - | | ||
| - | Step 2/9 : COPY haproxy.cfg / | ||
| - | | ||
| - | | ||
| - | Step 3/9 : LABEL version=" | ||
| - | | ||
| - | Removing intermediate container 33cd4aeca9b6 | ||
| - | | ||
| - | Step 4/9 : LABEL type=" | ||
| - | | ||
| - | Removing intermediate container 6070b706fb6d | ||
| - | | ||
| - | Step 5/9 : EXPOSE 80/tcp | ||
| - | | ||
| - | Removing intermediate container b800919bebd2 | ||
| - | | ||
| - | Step 6/9 : EXPOSE 80/udp | ||
| - | | ||
| - | Removing intermediate container df8d9d5c95db | ||
| - | | ||
| - | Step 7/9 : EXPOSE 443/tcp | ||
| - | | ||
| - | Removing intermediate container 9e8b3dcd642b | ||
| - | | ||
| - | Step 8/9 : EXPOSE 443/udp | ||
| - | | ||
| - | Removing intermediate container e87d071fb6ef | ||
| - | | ||
| - | Step 9/9 : EXPOSE 8080/tcp | ||
| - | | ||
| - | Removing intermediate container ddb64fc64b85 | ||
| - | | ||
| - | Successfully built 3e3076009603 | ||
| - | Successfully tagged haproxy: | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | On teste la configuration : | ||
| - | <code bash> | ||
| - | $ docker run -it --rm --name haproxy-syntax-check haproxy haproxy -c -f / | ||
| - | Configuration file is valid | ||
| - | </ | ||
| - | |||
| - | Lancer le container : | ||
| - | <code bas> | ||
| - | $ docker run -d -p 8080:8080 -p 443:443 -p 80:80 --name my-haproxy3 haproxy | ||
| - | |||
| - | $ docker ps | ||
| - | CONTAINER ID IMAGE COMMAND | ||
| - | 2c8973e841b2 | ||
| - | </ | ||
| - | |||
haproxy_sous_docker.1542546626.txt.gz · Dernière modification : (modification externe)
