-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update stages dockerfile for icubhead-withuser and robometry children
- Loading branch information
Showing
5 changed files
with
80 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
#here add all stuff necessary to run icub-tests | ||
#start from image passed by argument during build process. Usually it is icubteamcode/superbuild:master-unstable_source | ||
ARG SOURCE_IMG="none" | ||
ARG PROJECTS_DIR="/home/icub/projects" | ||
ARG INSTALL_DIR="/home/icub/install_dir" | ||
ARG release="none" | ||
ARG sbtag="none" | ||
|
||
ARG HOME_DIR=/home/icub | ||
ARG PROJECTS_DIR=${HOME_DIR}/projects | ||
ARG INSTALL_DIR=${HOME_DIR}/install_dir | ||
ARG release="master" | ||
ARG sbtag="Stable" | ||
ARG metadata="data" | ||
ARG METADATA_FILE=${INSTALL_DIR}/bin/setup_metadata.sh | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh | ||
|
||
# Define default user | ||
ARG USERNAME=icub | ||
|
||
FROM $SOURCE_IMG as superbuild_builder | ||
|
||
LABEL maintainer="[email protected], [email protected]" | ||
|
||
ARG HOME_DIR | ||
ARG PROJECTS_DIR | ||
ARG CMAKE_GENERATOR | ||
ARG BUILD_TYPE | ||
|
@@ -19,9 +27,18 @@ ARG INSTALL_DIR | |
ARG release | ||
ARG sbtag | ||
ARG METADATA_FILE | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
ARG USERNAME | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
USER $USERNAME | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
COPY setup.sh ${ROBOTOLOGY_INITIALIZATION_FILE} | ||
RUN sudo chown -R icub: /usr/local/bin/entrypoint.sh | ||
RUN sudo chown -R icub: /usr/local/bin/setup_robotology_tdd.sh | ||
|
||
# Some other definitions | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
|
@@ -58,6 +75,10 @@ ARG release | |
ARG sbtag | ||
ARG METADATA_FILE | ||
ARG metadata | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
ARG USERNAME | ||
|
||
USER $USERNAME | ||
|
||
COPY --from=superbuild_builder / / | ||
|
||
|
@@ -68,12 +89,11 @@ ENV CMAKE_PREFIX_PATH=${INSTALL_DIR} | |
ENV QT_X11_NO_MITSHM=1 | ||
ENV YARP_COLORED_OUTPUT=1 | ||
|
||
RUN echo "File metadata = ${METADATA_FILE}" &&\ | ||
echo 'echo 'This images has release=$release and had been built with superbuild_tag=$sbtag. Metadata=$metadata ' ' >> $METADATA_FILE | ||
RUN echo 'echo 'This images has release=$release and is built with superbuild_tag=$sbtag. Metadata=$metadata ' ' >> $METADATA_FILE | ||
|
||
RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
RUN echo "source ${METADATA_FILE}" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
|
||
|
||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
#start from image passed by argument during build process. Usually it is an ubuntu image plus mesa library. | ||
ARG START_IMG="none" | ||
|
||
FROM $START_IMG | ||
ARG HOME_DIR=/home/icub | ||
ARG INSTALL_DIR=${HOME_DIR}/install_dir | ||
ARG PROJECTS_DIR=${HOME_DIR}/projects | ||
ARG release="master" | ||
ARG sbtag="Stable" | ||
ARG metadata="data" | ||
ARG METADATA_FILE=${INSTALL_DIR}/bin/setup_metadata.sh | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh | ||
ARG USERNAME=icub | ||
|
||
FROM $START_IMG as builder | ||
|
||
LABEL maintainer="[email protected], [email protected]" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG USERNAME=icub | ||
ARG INSTALL_DIR | ||
ARG PROJECTS_DIR | ||
ARG release | ||
ARG sbtag | ||
ARG METADATA_FILE | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
# Define UID and GID | ||
ARG USERNAME | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
|
||
RUN apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
|
@@ -22,6 +39,7 @@ RUN groupadd --gid $USER_GID $USERNAME \ | |
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME | ||
|
||
|
||
# From here on all commands will be executed as $USERNAME user until FROM declaration | ||
USER $USERNAME | ||
|
||
RUN sudo mkdir /etc/bash_completion.d/ &&\ | ||
|
@@ -33,29 +51,15 @@ RUN sudo mkdir /etc/bash_completion.d/ &&\ | |
vim \ | ||
apt-utils | ||
|
||
|
||
#Some definitions | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
ARG CMAKE_EXTRA_OPTIONS=-j2 | ||
ARG INSTALL_DIR=/home/icub/install_dir | ||
ARG release="master" | ||
ARG sbtag="Stable" | ||
ARG METADATA_FILE=/home/icub/install_dir/bin/setup_metadata.sh | ||
|
||
|
||
# Setup entrypoint | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE=/usr/local/bin/setup_robotology_tdd.sh | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
COPY setup.sh ${ROBOTOLOGY_INITIALIZATION_FILE} | ||
RUN sudo chown -R icub: /usr/local/bin/entrypoint.sh | ||
RUN sudo chown -R icub: /usr/local/bin/setup_robotology_tdd.sh | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
|
||
|
||
ARG PROJECTS_DIR=/home/icub/projects | ||
#Some definitions | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
ARG CMAKE_EXTRA_OPTIONS=-j2 | ||
|
||
#ENV DEBIAN_FRONTEND=noninteractive is not sufficient | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections &&\ | ||
|
@@ -79,16 +83,30 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-sel | |
-DENABLE_yarpmod_grabber:BOOL=ON \ | ||
&&\ | ||
#Build all the projects &&\ | ||
cmake --build . --target update-all -- -j4 &&\ | ||
cmake --build . --target update-all -- ${CMAKE_EXTRA_OPTIONS} &&\ | ||
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} | ||
|
||
FROM scratch | ||
|
||
ARG PROJECTS_DIR | ||
ARG CMAKE_GENERATOR="Unix Makefiles" | ||
ARG BUILD_TYPE=Release | ||
ARG CMAKE_EXTRA_OPTIONS=-j2 | ||
ARG INSTALL_DIR | ||
ARG release | ||
ARG sbtag | ||
ARG METADATA_FILE | ||
ARG ROBOTOLOGY_INITIALIZATION_FILE | ||
ARG metadata | ||
ARG USERNAME | ||
|
||
USER $USERNAME | ||
|
||
RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
RUN echo "source ${METADATA_FILE}" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
COPY --from=builder / / | ||
|
||
# # The bashrc is read only when opening an interactive shell. Let other projects find packages contained | ||
# # in the superbuild. | ||
ENV CMAKE_PREFIX_PATH=${INSTALL_DIR} | ||
ENV CMAKE_PREFIX_PATH=${INSTALL_DIR} | ||
|
||
#add checkRobotInterface | ||
RUN cd ${PROJECTS_DIR} &&\ | ||
|
@@ -100,8 +118,7 @@ RUN cd ${PROJECTS_DIR} &&\ | |
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | ||
&&\ | ||
cmake --build . -- ${CMAKE_EXTRA_OPTIONS} && \ | ||
cp ./checkRobotInterface /home/icub/install_dir/bin | ||
|
||
cp ./checkRobotInterface ${INSTALL_DIR}/bin | ||
|
||
|
||
#The EXPOSE instruction does not actually publish the port. | ||
|
@@ -113,15 +130,12 @@ EXPOSE 10000/tcp 10000/udp | |
ENV QT_X11_NO_MITSHM 1 | ||
ENV YARP_COLORED_OUTPUT 1 | ||
|
||
RUN echo 'echo 'This images has release=$release and is built with superbuild_tag=$sbtag. Metadata=$metadata ' ' >> $METADATA_FILE | ||
|
||
RUN echo "source ${INSTALL_DIR}/share/robotology-superbuild/setup.sh" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
RUN echo "source ${METADATA_FILE}" >> $ROBOTOLOGY_INITIALIZATION_FILE | ||
|
||
ARG metadata="none" | ||
|
||
ENV img_metadata=${metadata} | ||
RUN echo "File metadata = ${METADATA_FILE}" | ||
RUN echo 'export img_metadata=${metadata}' >> $METADATA_FILE | ||
RUN echo 'echo 'This images has release=$release and had been building with superbuild_tag=$sbtag. Metadata=$metadata ' ' >> $METADATA_FILE | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] | ||
|
||
CMD ["bash"] | ||
|
2 changes: 1 addition & 1 deletion
2
dockerfile_images/basic/superbuild-icubhead-withuser/conf_build.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters