Skip to content

Instantly share code, notes, and snippets.

@hneiva
Created June 2, 2022 17:56
Show Gist options
  • Save hneiva/e7362279ab1303ec8d9e7179dc566014 to your computer and use it in GitHub Desktop.
Save hneiva/e7362279ab1303ec8d9e7179dc566014 to your computer and use it in GitHub Desktop.
Docker image with rcodesign and transporter

Docker rcodesign instructions

Note: Apple Transporter is only required for notarizing software

Resources

Requirements

Preparing a docker image with rcodesign and Transporter

Compiling rcodesign binary in docker and downloading Transporter

In your terminal:

# Start a docker container for compiling
# Note: Mounting your local folder to /target
docker run -it --rm -v $(pwd):/target debian:stable-slim

The container shell should now be open. Install requirements, compile rcodesign and download Transporter:

# Install required packages on the container
apt update && apt install curl cmake python3-pexpect -y
# Download and install Rust
curl https://sh.rustup.rs -sSf | sh -s -- -v -y
# Add cargo to PATH as suggested by installer
source $HOME/.cargo/env
# Cargo install will take awhile
cargo install apple-codesign
# Copy compiled rcodesign
cp $(which rcodesign) /target/

# Download Transporter
curl -o /target/iTMSTransporter_installer_linux.sh -v https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/resources/download/public/Transporter__Linux/bin

⚠️ Note: Apple's instructions suggest the downloaded package is gzipped, but does not seem to be the case.

You should now have rcodesign binary and Transporter installer locally.

Create a Dockerfile file with the following contents:

FROM debian:stable-slim

COPY rcodesign /usr/local/bin/
COPY iTMSTransporter_installer_linux.sh /root/

RUN apt update && apt install -y python3-pexpect
RUN python3 -c 'import pexpect; print(pexpect.run("/root/iTMSTransporter_installer_linux.sh", events={"--More--": "yes\n","Do you agree to the above license terms\?": "yes\n","Continue\?": "yes\n"}))'

RUN apt purge -y python3-pexpect && apt autoremove -y && apt-get clean all

Build docker image and run it

docker build -t rcodesign .
docker run -it --rm rcodesign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment