Skip to content

Commit 8a8cc37

Browse files
committed
add agent dockerfile
1 parent cf32e1c commit 8a8cc37

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Dockerfile-agent

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Flow Agent Dockerfile
3+
# Image Name: flowci/flow-agent
4+
#
5+
# https://github.com/FlowCI/flow-platform
6+
#
7+
FROM flowci/flow-platform-base:latest
8+
9+
# setup flow.ci default environments
10+
ENV FLOW_PLATFORM_SOURCE_CODE=/flow-platform
11+
ENV MVN_CACHE=/root/.m2
12+
ENV FLOW_AGENT_DIR=$HOME/agent
13+
14+
15+
# copy code
16+
COPY . $FLOW_PLATFORM_SOURCE_CODE
17+
18+
# mvn build and set wars to tomcat and delete no use thing
19+
RUN cd $FLOW_PLATFORM_SOURCE_CODE \
20+
&& rm -rf $FLOW_PLATFORM_SOURCE_CODE/dist \
21+
&& mvn clean install -DskipTests=true \
22+
&& mkdir -p $FLOW_PLATFORM_CONFIG_DIR \
23+
&& cd $FLOW_PLATFORM_SOURCE_CODE \
24+
&& mv ./dist/flow-agent-*.jar $FLOW_AGENT_DIR/flow-agent.jar \
25+
&& rm -rf $FLOW_PLATFORM_SOURCE_CODE \
26+
&& rm -rf $MVN_CACHE
27+
28+
29+
WORKDIR $FLOW_AGENT_DIR
30+
31+
CMD java -jar ./flow-agent.jar $FLOW_BASE_URL $FLOW_TOKEN

0 commit comments

Comments
 (0)