Skip to content

Commit

Permalink
Fixed: Docker warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbiely committed Oct 7, 2024
1 parent e4f8410 commit 58c2203
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
35 changes: 20 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM ubuntu:20.04

ENV LANG C.UTF-8
ENV LANG=C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive

CMD /bin/bash
####################################################################################################
# Use bash for shell
####################################################################################################
CMD ["/bin/bash"]

####################################################################################################
# Install basic dependencies
####################################################################################################
RUN apt update && apt install -y --no-install-recommends \
software-properties-common \
clang \
clang-format \
clangd \
llvm \
g++ \
gcc \
Expand All @@ -21,17 +25,18 @@ RUN apt update && apt install -y --no-install-recommends \
ninja-build \
neovim \
valgrind \
python3.8-venv \
openssh-server \
&& git clone --branch stable https://github.com/rui314/mold.git \
&& cd mold \
&& ./install-build-deps.sh \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -B build \
&& cmake --build build -j$(nproc) \
&& cmake --build build --target install \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
openssh-server

####################################################################################################
# Purge the apt list
####################################################################################################
RUN rm -rf /var/lib/apt/lists/*

####################################################################################################
# Set up ssh
####################################################################################################
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& echo 'root:docker' | chpasswd

EXPOSE 22
ENTRYPOINT service ssh restart && bash
ENTRYPOINT ["sh", "-c", "service ssh restart && exec bash"]
28 changes: 23 additions & 5 deletions docker/amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
FROM amd64/ubuntu:20.04

ENV LANG C.UTF-8
ENV LANG=C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive

CMD /bin/bash
####################################################################################################
# Use bash for shell
####################################################################################################
CMD ["/bin/bash"]

####################################################################################################
# Install basic dependencies
####################################################################################################
RUN apt update && apt install -y --no-install-recommends \
software-properties-common \
clang \
llvm \
g++ \
gcc \
gdb \
Expand All @@ -18,7 +25,18 @@ RUN apt update && apt install -y --no-install-recommends \
ninja-build \
neovim \
valgrind \
wget \
gpg-agent
openssh-server

RUN rm -rf /var/lib/apt/lists/*
####################################################################################################
# Purge the apt list
####################################################################################################
RUN rm -rf /var/lib/apt/lists/*

####################################################################################################
# Set up ssh
####################################################################################################
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& echo 'root:docker' | chpasswd

EXPOSE 22
ENTRYPOINT ["sh", "-c", "service ssh restart && exec bash"]
7 changes: 4 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ else()
if(NOT CMAKE_GENERATOR MATCHES "Xcode")
# Make sure xcodebuild is installed. Otherwise we won't be able to tell is the workaround
# needs to be applied
find_program(XCODEBUILD_EXECUTABLE NAMES xcodebuild)
find_program(XCODEBUILD_EXECUTABLE xcodebuild)

if(XCODEBUILD_EXECUTABLE)
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down Expand Up @@ -281,10 +281,11 @@ if(GAIA_MAKE_SINGLE_HEADER)
endif()

add_custom_target(generate_single_header ALL)

if(WIN32)
set(generate_single_header_path "make_single_header.bat")
else()
set(generate_single_header_path "./make_single_header.sh")
set(generate_single_header_path "./make_single_header.sh")
endif()

add_custom_command(
Expand All @@ -298,7 +299,7 @@ endif()
if(GAIA_GENERATE_CC)
add_custom_target(generate_compile_commands ALL)
add_custom_command(
COMMENT "Generating compile_commands.json in: ${CMAKE_BINARY_DIR}/ninja"
COMMENT "Generating compile_commands.json in: ${CMAKE_BINARY_DIR}/ninja"
TARGET generate_compile_commands POST_BUILD
COMMAND ${CMAKE_COMMAND} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G "Ninja" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -S ${CMAKE_SOURCE_DIR} -B ${CMAKE_BINARY_DIR}/ninja -DGAIA_DEVMODE=${GAIA_DEVMODE} -DGAIA_PROFILER_CPU=${GAIA_PROFILER_CPU} -DGAIA_PROFILER_MEM=${GAIA_PROFILER_MEM}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_SOURCE_DIR}/ninja
Expand Down

0 comments on commit 58c2203

Please sign in to comment.