File tree Expand file tree Collapse file tree 5 files changed +70
-7
lines changed
aws/dockerfiles/files/bin Expand file tree Collapse file tree 5 files changed +70
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+ set -e
4
+
3
5
DIAGNOSTICS_MAGIC_PORT=44554
4
- NODES=$( docker node inspect $( docker node ls -q) | jq -r ' .[] | .Description.Hostname' | tr ' \n' ' ' )
6
+
7
+ platform ()
8
+ {
9
+ # TODO: This will need to be changed if the current configuration of
10
+ # system containers are not invoked via 'docker run' anymore
11
+ #
12
+ # (and/or might be more elegant to pass in the platform via environment
13
+ # variables, etc.)
14
+ PLATFORM=$( docker images | grep aws)
15
+ if [ $? -eq 0 ]
16
+ echo " aws"
17
+ then
18
+ echo " azure"
19
+ fi
20
+ }
21
+
22
+ node_hostnames ()
23
+ {
24
+ docker node inspect $( docker node ls -q) | jq -r ' .[] | .Description.Hostname'
25
+ }
26
+
27
+ azure_resolver ()
28
+ {
29
+ # Sample /etc/resolv.conf on Azure:
30
+ #
31
+ # # Generated by dhcpcd from eth0.dhcp
32
+ # # /etc/resolv.conf.head can replace this line
33
+ # domain zopqyteo2tpuxc1cyzroivpijh.gx.internal.cloudapp.net
34
+ # nameserver 168.63.129.16
35
+ # # /etc/resolv.conf.tail can replace this line
36
+ #
37
+ cat /etc/resolv.conf | grep domain | awk ' { print $2; }'
38
+ }
39
+
40
+ if [ " $( platform) " = " aws" ]
41
+ then
42
+ NODES=$( node_hostnames)
43
+ else
44
+ # We need to append to the hostnames with the DNS resolver address, or
45
+ # else they won't resolve properly.
46
+ #
47
+ # We could potentially modify swarm to accept a "hostname" (more
48
+ # properly nodename) type flag on join, but no such option seems
49
+ # available today.
50
+ NODES=$( node_hostnames | sed -e " s/$/.$( azure_resolver) /" )
51
+ fi
5
52
6
53
# Session is set to a pseudo-random string combined with the current timestamp.
7
54
# This should minimize the probability of collision while also providing
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ RUN apk add --no-cache --update \
20
20
21
21
# Windows Azure Linux agent section
22
22
RUN pip install pyasn1
23
- ENV AGENT_REVISION ef3d68857cf08b65bbe7dfeb7a811cc9f1aa5bc1
23
+ ENV AGENT_REVISION 5d66b1c923fcccf1f00b6004627f7f3d46172142
24
24
25
25
# TODO: Move back to upstream (a PR is out for this on the Azure agent --
26
26
# https://github.com/Azure/WALinuxAgent/pull/341), for now we have to use this
@@ -35,7 +35,7 @@ RUN cp bin/* /usr/sbin/
35
35
# TODO: If upstream shell Dockerfile changes this will also need to be changed.
36
36
# Should be implemented more elegantly.
37
37
RUN mkdir /daemons && \
38
- mv /entry.sh /daemons/sshd-entrypoint .sh && \
38
+ rm /entry.sh && \
39
39
mv /etc/ssh/sshd_config /opt/sshd_config && \
40
40
mv /etc/motd /opt/motd
41
41
Original file line number Diff line number Diff line change
1
+ TAG := latest
2
+
1
3
default : build
2
4
3
5
build :
4
- docker build -t docker4x/agent-azure .
6
+ docker build -t docker4x/agent-azure: $( TAG ) .
5
7
6
8
push : build
7
- docker push docker4x/agent-azure
9
+ docker push docker4x/agent-azure: $( TAG )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ user=root
11
11
childlogdir=/var/log/
12
12
13
13
[program:sshd]
14
- command=bash -c "sleep 5; /daemons/sshd-entrypoint.sh / usr/sbin/sshd -D -f /etc/ssh/sshd_config"
14
+ command=bash -c "sleep 5; /usr/sbin/sshd -D -f /etc/ssh/sshd_config"
15
15
startretries=100
16
16
autorestart=true
17
17
Original file line number Diff line number Diff line change 350
350
"direction" : " Inbound"
351
351
}
352
352
},
353
+ {
354
+ "name" : " diagnostics" ,
355
+ "properties" : {
356
+ "description" : " Allow communication for the diagnostics server" ,
357
+ "protocol" : " Tcp" ,
358
+ "sourcePortRange" : " *" ,
359
+ "destinationPortRange" : " 44554" ,
360
+ "sourceAddressPrefix" : " [variables('subnetPrefix')]" ,
361
+ "destinationAddressPrefix" : " [variables('subnetPrefix')]" ,
362
+ "access" : " Allow" ,
363
+ "priority" : 205 ,
364
+ "direction" : " Inbound"
365
+ }
366
+ },
353
367
{
354
368
"name" : " docker-port" ,
355
369
"properties" : {
360
374
"sourceAddressPrefix" : " [variables('subnetPrefix')]" ,
361
375
"destinationAddressPrefix" : " [variables('subnetPrefix')]" ,
362
376
"access" : " Allow" ,
363
- "priority" : 205 ,
377
+ "priority" : 206 ,
364
378
"direction" : " Inbound"
365
379
}
366
380
}
You can’t perform that action at this time.
0 commit comments