Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulation-2d docker Image #7

Closed
wants to merge 2 commits into from
Closed

Simulation-2d docker Image #7

wants to merge 2 commits into from

Conversation

Pvcunha
Copy link

@Pvcunha Pvcunha commented Jan 12, 2023

Adds the simulation-2d dockerfile

FROM robocin/cpp-ubuntu-20.04:latest

# packages setup
RUN apt update
Copy link
Member

@fnalmeidap fnalmeidap Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Já é resolvido em robocin/cpp-ubuntu-20.04:latest. Não seria redundante?

E além disso, apenas o upstream das fontes é atualizado com apt update, não há mudança no sistema.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sinceramente, eu só copiei o Dockerfile.exodia do simulation-2d-cpp e queria ver a action em ação. Tem que mudar algumas coisas até pra começar a usar o robocin-install

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode remover sim [link]

cd rcssmonitor && ./bootstrap && ./configure && \
make && make install && \
cd /root && rm -rf rcssmonitor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Podemos ter aqui também o Fedit e o Soccerwindow2.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sim!


# Set environment variables.
ENV HOME /root
ENV DISPLAY :0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variável mágica? Podes explicar o uso dela?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kkkkkk mágica demais, é pra definir o display padrão pro localhost

Gui apps em docker https://link.medium.com/MDgtowncwwb

O que é a variavel de ambiente display https://askubuntu.com/questions/432255/what-is-the-display-environment-variable

Basicamente quando nós rodamos um container docker temos que definir a flag -e DISPLAY=$DISPLAY pra usar a env do PC host, aí eu tô definindo para a padrao ser :0 que é a normalmente utilizada só pra evitar a flag em momentos futuros

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho show, mas essa imagem ainda é meio que uma base, poderíamos puxar pro primeiro pai, ou colocar nas imagens filhas / no devcontainer.json

# rcssserver install
WORKDIR /root
RUN git clone https://github.com/rcsoccersim/rcssserver.git
RUN \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Podemos incluir a primeira chamada do rcssserver para ele criar as configurações do server no arquivo/pasta oculta autogerada por ele.

@@ -0,0 +1,49 @@
# Disclaimer:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O dockerfile não utiliza módulos já baixados, não entendi o disclaimer. Podes clarificar?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O disclaimer é pq eu literalmente copiei, te amo não me bate


RUN apt install -yq x11-apps

# Define default command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Os comandos do docker são autoexplicativos. Usar comentários apenas em situações que a informação contida no código não seja suficiente para o seu entendimento.

Copy link
Member

@joseviccruz joseviccruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sinceramente, eu só copiei o Dockerfile.exodia do simulation-2d-cpp e queria ver a action em ação. Tem que mudar algumas coisas até pra começar a usar o robocin-install

Opa, eu vi isso, mas comentei coisas pra deixar normalizado a imagem, no final ela poderia ficar assim:

FROM robocin/cpp-ubuntu-20.04:latest

ARG QT=5.15.2

RUN robocin-install \
    boost \
    'qt ${QT}' \
    rcssserver \
    rcssmonitor # \
    # fedit \
    # soccerwindow2

ENV PATH /opt/qt/${QT}/gcc_64:$PATH

Sobre colocar as deps em /opt no lugar de /root, é pq é exatamente o diretório que cumpre com esse próposito [link]

Comment on lines 48 to 49
# Define default command.
CMD ["bash"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMD ["bash"] já é setado previamente, pode remover


# Setup tzdata
RUN \
apt-get install -yq tzdata && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tzdata parece ser instalado previamente, pode remover

FROM robocin/cpp-ubuntu-20.04:latest

# packages setup
RUN apt update
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pode remover sim [link]

Comment on lines 15 to 16
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essas configs são realmente necessárias?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Então, quando eu tava fazendo os updates pro Ubuntu 20.04 ele travava numa parte que ficava pedindo pra definir a timezone, e a solução que eu achei foi esse troço aí kkkkkk

https://dev.to/0xbf/set-timezone-in-your-docker-image-d22

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qual o sw que exigiu? Eu já me deparei com esse problema mesmo, lembrei agr, mas era quando a gente puxava da imagem do ubuntu padrão
Como nossa imagem puxa de uma imagem de devcontainer, acho que isso é resolvido por baixo dos panos... Tenta seguir sem isso 🤔

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm não lembro ao certo, era algum desses pacotes que vem logo em sequencia. Creio que tenha sido o build-essential.

Pronto massa, vou tentar sem

Comment on lines 19 to 21
RUN apt install -yq \
git build-essential automake autoconf libtool flex bison libboost-all-dev \
qt5-default libfontconfig1-dev libaudio-dev libxt-dev libglib2.0-dev libxi-dev libxrender-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que tudo aqui já foi instalado, exceto o qt5-default. Sugestão de substituição:

ARG QT=5.15.2
RUN robocin-install 'qt ${QT}'
ENV PATH /opt/qt/${QT}/gcc_64:$PATH

Baseado no link.

Comment on lines 25 to 29
RUN git clone https://github.com/rcsoccersim/rcssserver.git
RUN \
cd rcssserver && ./bootstrap && ./configure && \
make && make install && \
cd /root && rm -rf rcssserver
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adicionar rcssserver.sh no repo de scripts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exemplo: googletest.sh

Comment on lines 32 to 38
WORKDIR /root
RUN git clone https://github.com/rcsoccersim/rcssmonitor.git
RUN \
cd rcssmonitor && ./bootstrap && ./configure && \
make && make install && \
cd /root && rm -rf rcssmonitor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adicionar rcssmonitor.sh no repo de scripts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exemplo: googletest.sh

cd /root && rm -rf rcssserver

# rcssmonitor install
WORKDIR /root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poderia ser na pasta /opt ao invés de /root?

ENV DISPLAY :0

# Define working directory.
WORKDIR /root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poderia ser na pasta /opt ao invés de /root?


# Set environment variables.
ENV HOME /root
ENV DISPLAY :0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho show, mas essa imagem ainda é meio que uma base, poderíamos puxar pro primeiro pai, ou colocar nas imagens filhas / no devcontainer.json

Copy link
Member

@joseviccruz joseviccruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ersaraujo
Copy link
Member

@Pvcunha qual o status?

@Pvcunha Pvcunha closed this Dec 7, 2023
@Pvcunha
Copy link
Author

Pvcunha commented Dec 7, 2023

@Pvcunha qual o status?

@ersaraujo
Esse PR foi descontinuado. Ele pode ser encontrado e o devcontainer ja foi resolvido por essa imagem https://github.com/robocin/simulation-2d-cpp/tree/main/.devcontainer

Alem disso, continua sendo adicionadas outras necessidades que surgiram por binho como pode ser visto nesse PR atual https://github.com/robocin/simulation-2d-cpp/pull/283

@Pvcunha Pvcunha deleted the feat/docker_2d branch December 7, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants