With podman in docker, everyone wants to get along and use docker on a shared computer

Reasons to use podman in docker

When using Docker for computational purposes, you want to use singularity. However, since singularity cannot be built without sudo privileges, I asked podman in docker to work instead of everyone's working VM.

What is podman?

It's like Redhat's docker, and I think it's characterized by the lack of daemons.

Image of use

When using it, ssh login to each VM and use it. Make the VM disposable and move files with scp etc.

image.png

Creating an image


FROM docker.io/library/docker:dind

RUN apk --update add \
    bash \
    py-pip \
    supervisor \
    openssh \
    curl \
    build-base \
    libffi-dev \
    && \
    rm -rf /var/cache/apk/*

RUN apk add python3-dev
RUN apk add --no-cache libressl-dev musl-dev libffi-dev
RUN pip install docker-compose
RUN mkdir -p /var/log/supervisor


RUN apk add --no-cache openssh openrc
RUN rc-update add sshd && rc-status
RUN mkdir -p /run/openrc/ && touch /run/openrc/softlevel
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
RUN ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

RUN apk add singularity

RUN sed -i '2s/^/bash -c "\/usr\/sbin\/sshd -D"\&\n/' /usr/local/bin/dockerd-entrypoint.sh


RUN apk add sudo


RUN echo -e "<password here>\n<password here>" | (adduser user -s /bin/bash)
RUN addgroup docker
RUN addgroup user docker
RUN addgroup user wheel
RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

Start up etc.

#!/bin/bash

count=7000
for i in 0 1 2 3 4 5 6 7 8 9;
do
    echo $i
    sudo podman run -d --privileged -p 777$i:22 dind-docker
done

You can use it by creating an image on the container, creating a .sif file with singularity build, and moving it to your home with scp.

Recommended Posts

With podman in docker, everyone wants to get along and use docker on a shared computer
Starting with installing Docker on EC2 and running Yellowfin in a container
A story about trying to get along with Mockito
Build a Node-RED environment with Docker to move and understand
Write DiscordBot to Spreadsheets Write in Ruby and run with Docker
What to do if you get a gcc error in Docker
A solution to Docker errors that beginners tend to get stuck in
Make a C compiler to use with Rust x CLion with Docker
How to run a job with docker login in AWS batch
Use Jenkins to build inside Docker and then create a Docker image.
Steps to install Maven on Mac and use it in Eclipse
How to get JDK 11 on your mac in a comfortable way
How to get along with Rails
I tried to build a Firebase application development environment with Docker in 2020
If you get stuck with PHPStorm and xdebug on docker. trouble shooting
Put Zabbix in Ubuntu with Docker and monitor Docker on the same host
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
[AWS CLI] Switch roles to get a Docker image in another account
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Use MyBatis to get Map with key as identifier and value as Entity
How to start a Docker container with a volume mounted in a batch file
A memorandum on how to use Eclipse
Scraping with puppeteer in Nuxt on Docker.
How to use Docker in VSCode DevContainer
Understand in 5 minutes !! How to use Docker
Connect with VS Code from a Windows client to Docker on another server
How to get the ID of a user authenticated with Firebase in Swift
Volume that wants to use a lot of logical operators in if statements
Build a development environment to create Ruby on Jets + React apps with Docker
[Introduction to Docker] Create a Docker image for machine learning and use Jupyter notebook
How to use Eclipse on my PC with 32bit and 2GB of memory
How to build a Jenkins server with a Docker container on CentOS 7 of VirtualBox and access the Jenkins server from a local PC
Prepare a scraping environment with Docker and Java
How to use docker compose with NVIDIA Jetson
How to use nginx-ingress-controller with Docker for Mac
Get along with Java containers in Cloud Run
Link Docker log to AWS CloudWatch and monitor in real time with VS Code
Create a Java (Gradle) project with VS Code and develop it on a Docker container
[Rails] [Docker] Copy and paste is OK! How to build a Rails development environment with Docker
How to create a header or footer once and use it on another page
Create a private key / public key in CentOS8.2 and connect to SSH with VS Code
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant
I want to use PowerMock in a class that combines parameterized tests and ordinary tests
Docker command to create Rails project with a single blow in environment without Ruby
Create a Java (Maven) project with VS Code and develop it on a Docker container
How to use a structure with variable length array or bit field in Ruby-FFI