File tree 3 files changed +16
-11
lines changed
3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import setupDNS from '../tasks/setupDNS';
6
6
import proxyConfig from '../containers/proxyConfig' ;
7
7
import dnsmasqConfig from '../containers/dnsmasqConfig' ;
8
8
9
- const start = ( ) =>
9
+ const start = port =>
10
10
new Listr ( [
11
11
{
12
12
title : 'Start dotdocker containers' ,
@@ -26,9 +26,9 @@ const start = () =>
26
26
title : 'Start dnsmasq' ,
27
27
task : ( ) =>
28
28
new Listr ( [
29
- pullImage ( dnsmasqConfig ) ,
30
- createContainer ( dnsmasqConfig ) ,
31
- startContainer ( dnsmasqConfig ) ,
29
+ pullImage ( dnsmasqConfig ( port ) ) ,
30
+ createContainer ( dnsmasqConfig ( port ) ) ,
31
+ startContainer ( dnsmasqConfig ( port ) ) ,
32
32
] ) ,
33
33
} ,
34
34
] ,
Original file line number Diff line number Diff line change 1
- export default {
1
+ export default port => ( {
2
2
Image : 'andyshinn/dnsmasq:latest' ,
3
3
name : 'dotdocker-dnsmasq' ,
4
4
Cmd : [ '--address=/docker/127.0.0.1' , '--log-facility=-' ] ,
5
5
ExposedPorts : {
6
- '53 /tcp' : { } ,
7
- '53 /udp' : { } ,
6
+ [ ` ${ port } /tcp` ] : { } ,
7
+ [ ` ${ port } /udp` ] : { } ,
8
8
} ,
9
9
HostConfig : {
10
10
PortBindings : {
11
11
'53/tcp' : [
12
12
{
13
- HostPort : '53' ,
13
+ HostPort : ` ${ port } ` ,
14
14
} ,
15
15
] ,
16
16
'53/udp' : [
17
17
{
18
- HostPort : '53' ,
18
+ HostPort : ` ${ port } ` ,
19
19
} ,
20
20
] ,
21
21
} ,
22
22
RestartPolicy : { Name : 'always' } ,
23
23
CapAdd : [ 'NET_ADMIN' ] ,
24
24
} ,
25
- } ;
25
+ } ) ;
Original file line number Diff line number Diff line change @@ -4,14 +4,19 @@ import stop from './actions/stop';
4
4
import restart from './actions/restart' ;
5
5
import { version } from '../package.json' ;
6
6
7
+ const isDarwin = process . platform === 'darwin' ;
8
+
7
9
program
8
10
. version ( version )
9
11
. description ( 'A utility to help setup a docker development environment with host based routing' ) ;
10
12
11
13
program
12
14
. command ( 'start' )
15
+ . option ( '-p, --port <port>' , 'port' )
13
16
. description ( 'Pull and start the dotdocker containers and configure DNS' )
14
- . action ( start ) ;
17
+ . action ( res => {
18
+ start ( isDarwin ? res . port : 53 ) ;
19
+ } ) ;
15
20
16
21
program
17
22
. command ( 'stop' )
You can’t perform that action at this time.
0 commit comments