File tree Expand file tree Collapse file tree 6 files changed +71
-8
lines changed
aws/dockerfiles/files/bin Expand file tree Collapse file tree 6 files changed +71
-8
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 @@ -26,4 +26,4 @@ docker run --log-driver=json-file --restart=no -d -e ROLE="$ROLE" -e REGION="$R
26
26
docker run --log-driver=json-file --restart=always -d -e ROLE=" $ROLE " -e REGION=" $REGION " -e TENANT_ID=" $TENANT_ID " -e APP_ID=" $APP_ID " -e APP_SECRET=" $APP_SECRET " -e ACCOUNT_ID=" $ACCOUNT_ID " -e GROUP_NAME=" $GROUP_NAME " -e PRIVATE_IP=" $MANAGER_IP " -e DOCKER_FOR_IAAS_VERSION=" $DOCKER_FOR_IAAS_VERSION " -e SWARM_INFO_TABLE=" $SWARM_INFO_TABLE " -e SWARM_INFO_STORAGE_ACCOUNT=" $SWARM_INFO_STORAGE_ACCOUNT " -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v /var/log:/var/log docker4x/guide-azure:" $DOCKER_FOR_IAAS_VERSION "
27
27
echo default: " $LB_NAME " >> /var/lib/docker/swarm/elb.config
28
28
echo " $LB_NAME " > /var/lib/docker/swarm/lb_name
29
- docker run --log-driver=json-file -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/swarm:/var/lib/docker/swarm --name=editions_controller docker4x/l4controller-azure:" $DOCKER_FOR_IAAS_VERSION " run --ad_app_id=" $APP_ID " --ad_app_secret=" $APP_SECRET " --subscription_id=" $SUB_ID " --resource_group=" $GROUP_NAME " --log=4 --default_lb_name=" $LB_NAME " --environment=AzurePublicCloud
29
+ docker run -d - -log-driver=json-file -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/swarm:/var/lib/docker/swarm --name=editions_controller docker4x/l4controller-azure:" $DOCKER_FOR_IAAS_VERSION " run --ad_app_id=" $APP_ID " --ad_app_secret=" $APP_SECRET " --subscription_id=" $SUB_ID " --resource_group=" $GROUP_NAME " --log=4 --default_lb_name=" $LB_NAME " --environment=AzurePublicCloud
Original file line number Diff line number Diff line change 342
342
"direction" : " Inbound"
343
343
}
344
344
},
345
+ {
346
+ "name" : " diagnostics" ,
347
+ "properties" : {
348
+ "description" : " Allow communication for the diagnostics server" ,
349
+ "protocol" : " Tcp" ,
350
+ "sourcePortRange" : " *" ,
351
+ "destinationPortRange" : " 44554" ,
352
+ "sourceAddressPrefix" : " [variables('subnetPrefix')]" ,
353
+ "destinationAddressPrefix" : " [variables('subnetPrefix')]" ,
354
+ "access" : " Allow" ,
355
+ "priority" : 205 ,
356
+ "direction" : " Inbound"
357
+ }
358
+ },
345
359
{
346
360
"name" : " docker-port" ,
347
361
"properties" : {
352
366
"sourceAddressPrefix" : " [variables('subnetPrefix')]" ,
353
367
"destinationAddressPrefix" : " [variables('subnetPrefix')]" ,
354
368
"access" : " Allow" ,
355
- "priority" : 205 ,
369
+ "priority" : 206 ,
356
370
"direction" : " Inbound"
357
371
}
358
372
}
You can’t perform that action at this time.
0 commit comments