Running Xcode build #540

Open
opened 2025-12-29 01:21:14 +01:00 by adam · 1 comment
Owner

Originally created by @webdobe on GitHub (Oct 8, 2023).

I have been unable to figure out how to gain access to xcode command line tools which doesn't allow my builds to finish:

FROM sickcodes/docker-osx:auto

USER root
RUN pacman -Sy unzip --noconfirm

USER arch

Install Homebrew and dependencies

RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RUN (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/arch/.profile
ENV PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin"
RUN brew install gcc
RUN brew install nvm
#RUN brew install ruby@3.2
RUN brew install ruby-build && brew install rbenv

Configure nvm environment variables and source nvm

RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /home/arch/.profile &&
echo '[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && . "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh"' >> /home/arch/.profile &&
echo '[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm"' >> /home/arch/.profile &&
mkdir -p /home/arch/.nvm

Set the SHELL to use a login bash shell for subsequent RUN commands

SHELL ["/bin/bash", "-l", "-c"]

Using nvm commands in the RUN directive requires loading the nvm script

RUN nvm install 19

RUN echo "export NODE_PATH=$(nvm which 19)" >> /home/arch/.profile

RUN echo "export PATH=$NODE_PATH:$PATH" >> /home/arch/.profile

RUN echo $USER

Copy source and execute necessary commands

COPY --chown=arch:arch . /app
WORKDIR /app
RUN nvm use 19
RUN ls -al

RUN rbenv install 3.2.2
RUN rbenv global 3.2.2
RUN echo "eval '$(rbenv init - bash)'" >> /home/arch/.profile
RUN ruby -v
RUN gem install bundler
RUN bundle install

WORKDIR /app/ios

this line fails because xcode does not exist.

RUN bundle exec pod install

WORKDIR /app
RUN npm run ios -- --mode="Release"

Originally created by @webdobe on GitHub (Oct 8, 2023). I have been unable to figure out how to gain access to xcode command line tools which doesn't allow my builds to finish: FROM sickcodes/docker-osx:auto USER root RUN pacman -Sy unzip --noconfirm USER arch # Install Homebrew and dependencies RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" RUN (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/arch/.profile ENV PATH="${PATH}:/home/linuxbrew/.linuxbrew/bin" RUN brew install gcc RUN brew install nvm #RUN brew install ruby@3.2 RUN brew install ruby-build && brew install rbenv # Configure nvm environment variables and source nvm RUN echo 'export NVM_DIR="$HOME/.nvm"' >> /home/arch/.profile && \ echo '[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh"' >> /home/arch/.profile && \ echo '[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm"' >> /home/arch/.profile && \ mkdir -p /home/arch/.nvm # Set the SHELL to use a login bash shell for subsequent RUN commands SHELL ["/bin/bash", "-l", "-c"] # Using nvm commands in the RUN directive requires loading the nvm script RUN nvm install 19 RUN echo "export NODE_PATH=$(nvm which 19)" >> /home/arch/.profile RUN echo "export PATH=\$NODE_PATH:\$PATH" >> /home/arch/.profile RUN echo $USER # Copy source and execute necessary commands COPY --chown=arch:arch . /app WORKDIR /app RUN nvm use 19 RUN ls -al RUN rbenv install 3.2.2 RUN rbenv global 3.2.2 RUN echo "eval '$(rbenv init - bash)'" >> /home/arch/.profile RUN ruby -v RUN gem install bundler RUN bundle install WORKDIR /app/ios # this line fails because xcode does not exist. RUN bundle exec pod install WORKDIR /app RUN npm run ios -- --mode="Release"
Author
Owner

@RambokDev commented on GitHub (Apr 29, 2024):

Hi have the same problem with xcodebuild, i cant use this command, any idea ? thanks

@RambokDev commented on GitHub (Apr 29, 2024): Hi have the same problem with xcodebuild, i cant use this command, any idea ? thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#540