sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
35.96k stars 1.77k forks source link

Running Xcode build #707

Open webdobe opened 8 months ago

webdobe commented 8 months ago

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"

RambokDev commented 1 month ago

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