Skip to content

Commit 415233c

Browse files
authored
Merge pull request #137 from hmakelin/fix-gisnav-dockerfile
Fix gisnav Dockerfile
2 parents 92ff002 + 8110757 commit 415233c

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

docker/mavros/Dockerfile

+7-18
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ ENV ROS_DISTRO=${ROS_DISTRO}
4040

4141
WORKDIR /opt/colcon_ws/src/
4242

43-
# Copy package.xml only to install system dependencies
44-
COPY ros/gisnav/package.xml gisnav/ros/gisnav/package.xml
43+
# .git needed to make pre-commit and git describe work. We create a shallow
44+
# copy of the repo to avoid carrying over all of commit history.
45+
COPY . /tmp/gisnav
46+
RUN git clone --depth 1 /tmp/gisnav/ gisnav/ && \
47+
rm -rf /tmp/gisnav
4548

4649
# Install GISNav system dependencies - we will install
4750
# the setup.py python dependencies later.
@@ -59,9 +62,6 @@ RUN git clone --branch release/1.14 https://github.com/px4/px4_msgs.git && \
5962
cd .. && \
6063
colcon build --packages-select px4_msgs
6164

62-
# Copy rest of gisnav ros2 package
63-
COPY ros/ gisnav/ros
64-
6565
WORKDIR /opt/colcon_ws/src/gisnav/
6666

6767
# Install python dependencies, mainly torch and related CUDA deps
@@ -73,9 +73,8 @@ RUN cd ros/gisnav && \
7373
source install/setup.bash && \
7474
colcon build --packages-select gisnav gisnav_msgs
7575

76-
COPY docker/mavros/gisnav/entrypoint.sh /
77-
78-
RUN chmod +x /entrypoint.sh
76+
RUN cp docker/mavros/gisnav/entrypoint.sh / && \
77+
chmod +x /entrypoint.sh
7978

8079
# Download LightGlue pretrained weights
8180
RUN python3 -c \
@@ -87,8 +86,6 @@ RUN apt-get update \
8786
&& rm -rf /var/lib/apt/lists/* \
8887
&& apt clean
8988

90-
COPY docs/ docs/
91-
9289
# Node 18 for building the docs (Sphinx dependencies already in setup.py)
9390
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
9491
&& source ~/.nvm/nvm.sh \
@@ -97,12 +94,4 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | b
9794
&& cd docs/vitepress \
9895
&& npm install
9996

100-
COPY Makefile .pre-commit-config.yaml LICENSE.md README.md pyproject.toml /opt/colcon_ws/src/gisnav/
101-
102-
# .git needed to make pre-commit and git describe work. We create a shallow
103-
# copy of the repo to avoid carrying over all of commit history.
104-
COPY .git /tmp/gisnav/.git
105-
RUN git clone --depth 1 /tmp/gisnav/.git /opt/colcon_ws/src/gisnav/.git && \
106-
rm -rf /tmp/gisnav/.git
107-
10897
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)