Version control CocoaPods with Docker

I think many teams use rbenv and Bundler to version control CocoaPods. The following is an example of using rbenv and Bundler to manage Ruby and CocoaPods versions. The Ruby version is fixed at 2.7.1, the Bundler version is fixed at 2.1.4, and the CocoaPods version is fixed at 1.9.2.

$ brew install rbenv ruby-build
$ rbenv install 2.7.1
$ gem install bundler -v 2.1.4
$ bundle config set path vendor/bundle
$ bundle _2.1.4_ install
$ bundle exec pod install

.ruby-version


2.7.1

Gemfile


source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem 'cocoapods', '1.9.2'
gem 'cocoapods-binary', '0.4.4'

This method requires the installation of rbenv, which raises the bar for building an environment for non-engineers such as designers. This time, I tried to lower the hurdle a little by managing CocoaPods with Docker.

Prepare the following DockerFile and build the image. Add plugins and merge layers as you like.

Dockerfile


FROM ruby:2.7.1

RUN gem install cocoapods -v 1.9.2
RUN gem install cocoapods-binary -v 0.4.4
RUN adduser cocoapods
USER cocoapods
RUN pod setup
WORKDIR /project
$ docker build -t cocoapods-docker .

Go to your project's directory and do pod install with the built image.

$ docker run --rm -v $PWD:/project cocoapods-docker pod install

I referred to this repository.

gdevillele/docker-cocoapods

Recommended Posts

Version control CocoaPods with Docker
Java version control with jenv
[SRE / Docker] Start control with Dockerize
GPU environment construction with Docker [October 2020 version]
Java version control with jenv on OSX
Spring Boot environment construction with Docker (January 2021 version)
Launch MariaDB with Docker
Rails deploy with Docker
Run Pico with docker
Explode Docker with WSL2
Use Puphpeteer with Docker
Operate Emby with Docker
Try WildFly with Docker
Use ngrok with Docker
Run Payara with Docker
[Rails version control] rails version downgrade
[Docker] Connection with MySQL
Php settings with Docker
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
Pytorch execution environment with Docker
Java version control on macOS
Use GDAL with Python with Docker
Ruby version switching with rbenv
Run TAO Core with Docker
Docker management with VS Code
Set up GitLab with docker
Control log output with Doma2
Run Rails whenever with docker
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
How to use mysql with M1 mac Docker preview version
Web application built with docker (1)
I tried BIND with Docker
React environment construction with Docker
Build DynamoDB local with Docker
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
Try Oracle Enterprise Manager Cloud Control with Docker Desktop for Windows
How to build Rails + Vue + MySQL environment with Docker [2020/09 latest version]
Rails + MySQL environment construction with Docker
Create a Vue3 environment with Docker!
Node.js environment construction with Docker Compose
Deploy a Docker application with Greengrass
Build Couchbase local environment with Docker
Install java with Ubuntu 16.04 based Docker
Build a Node.js environment with Docker
Environment construction with Docker for beginners
[PDO → DB connection with docker, PHP]
Run SQL Server with Docker ToolBox
Easily Docker Java applications with Jib
Why use orchestration tools with Docker
Build PlantUML environment with VSCode + Docker
Try running cloudera manager with docker
Molecular phylogenetics exercise with docker (working)
IP address interfered with Docker bridge
Build environment with vue.js + rails + docker
Read dump file with Docker MySQL