ocket8888 commented on code in PR #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r847821353
##########
dev/traffic_router/Dockerfile:
##########
@@ -13,26 +13,31 @@
#
FROM alpine:latest AS trafficrouter-dev
-ENV TC=/root/go/src/github.com/apache/trafficcontrol
-VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV
JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"
JAVA_HOME=/usr/lib/jvm/java-11-openjdk
M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2
CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
CATALINA_OPTS=-Dlog4j.configurationFile=/opt/traffic_router/conf/log4j2.xml
-EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+ENV TC=/go/src/github.com/apache/trafficcontrol
+VOLUME "$TC"
+ENV
JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"
\
Review Comment:
The only reason I did it in the order
```dockerfile
ENV
VOLUME
ENV
```
was because the first two lines could be shared as cache layers across
components. Since they're now different from the others, there's no reason the
two `ENV` directives can't be combined into a single cache layer.
##########
dev/traffic_router/Dockerfile:
##########
@@ -13,26 +13,31 @@
#
FROM alpine:latest AS trafficrouter-dev
-ENV TC=/root/go/src/github.com/apache/trafficcontrol
-VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV
JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"
JAVA_HOME=/usr/lib/jvm/java-11-openjdk
M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2
CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
CATALINA_OPTS=-Dlog4j.configurationFile=/opt/traffic_router/conf/log4j2.xml
-EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+ENV TC=/go/src/github.com/apache/trafficcontrol
+VOLUME "$TC"
+ENV
JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"
\
+ JAVA_HOME=/usr/lib/jvm/java-11-openjdk
M2_HOME=${TC}/trafficcontrol/.m2 \
+ CATALINA_BASE=/opt/traffic_router \
+ TRAFFIC_MONITOR_HOSTS=trafficmonitor \
+
CATALINA_OPTS=-Dlog4j.configurationFile=/opt/traffic_router/conf/log4j2.xml
+EXPOSE 3053:53/tcp \
+ 3053:53/udp \
+ 3080:80 \
+ 3443:443 \
+ 3333:3333 \
+ 2222:3443 \
+ 5005:5005
Review Comment:
any reason the indented lines here are indented twice?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]