Skip to content

Commit aacf039

Browse files
committed
STORM-4056 - Implement a docker-based alternativ to build with -Pnative on MacOS
1 parent 5aa2060 commit aacf039

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@ hs_err_pid*
5959

6060
# Test jars for zip slip
6161
!/storm-server/src/test/resources/evil-path-traversal.jar
62-
!/storm-server/src/test/resources/evil-path-traversal-resources.jar
62+
!/storm-server/src/test/resources/evil-path-traversal-resources.jar
63+
64+
m2
65+
install.txt
66+
install-shade.txt

dev-tools/docker/Dockerfile

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
FROM ubuntu:latest
16+
17+
RUN apt-get update && \
18+
apt-get install -y --no-install-recommends \
19+
curl \
20+
wget \
21+
git \
22+
bash \
23+
unzip \
24+
ca-certificates \
25+
autoconf \
26+
automake \
27+
libssl-dev libtool pkg-config \
28+
ruby ruby-dev \
29+
python3.10 pip \
30+
openjdk-17-jdk \
31+
build-essential && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
# Install Node.js 20.x
35+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
36+
apt-get install -y nodejs && \
37+
npm install -g npm@latest
38+
39+
# Set up Maven
40+
ARG MAVEN_VERSION=3.9.9
41+
RUN wget https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.zip && \
42+
unzip apache-maven-${MAVEN_VERSION}-bin.zip -d /opt && \
43+
ln -s /opt/apache-maven-${MAVEN_VERSION}/bin/mvn /usr/bin/mvn && \
44+
rm apache-maven-${MAVEN_VERSION}-bin.zip
45+
46+
# Set environment variables for Maven and Java
47+
ENV MAVEN_HOME=/opt/apache-maven-${MAVEN_VERSION}
48+
ENV PATH="${MAVEN_HOME}/bin:${PATH}"
49+
50+
USER ubuntu

dev-tools/docker/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Apache Storm Development Dockerfile
2+
3+
This Dockerfile provides a complete development environment for Apache Storm, aligning with the GitHub Actions CI setup
4+
for building and testing various modules of Apache Storm.
5+
6+
It installs and configures Java, Maven, Python, Node.js, and Ruby, allowing you to run builds and tests for different Storm modules in a containerized environment.
7+
8+
This is especially useful for people on Mac OSX or Windows. It also provides a consistent environment for all developers.
9+
10+
## Usage
11+
12+
Build it by running:
13+
14+
```bash
15+
docker build -t storm-dev .
16+
```
17+
18+
## Run a build
19+
20+
```bash
21+
docker run -it \
22+
--name storm-dev \
23+
-e MAVEN_OPTS="-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k" \
24+
-v $(pwd)/m2:/home/ubuntu/.m2 \
25+
-v $(pwd):/opt/project \
26+
-w /opt/project \
27+
storm-dev
28+
```
29+
30+
Advanced cases such as remote debugging are also possible. Just map the debugger port and start maven accordingly.

0 commit comments

Comments
 (0)