[LINUX] I want to create a Dockerfile for the time being.

I wrote a Dockerfile template with a wide range of applications.

I like Archlilux. So I like pacman and aur. I like archwiki and pkgbuild. I want to apply it to Docker as it is. And I want to use it as it is on the server, and I want to apply it to development.

FROM archlinux/base
ARG PKG="yay"
RUN curl https://www.archlinux.org/mirrorlist/\?country\=JP\&protocol\=https\&ip_version\=4\&ip_version\=6 > /tmp/mirrorlist && sed -e "s/^#//g" /tmp/mirrorlist > /etc/pacman.d/mirrorlist && yes "" | pacman -Syy git base-devel
RUN useradd -m -s /bin/bash docker
RUN echo 'Defaults visiblepw'            >> /etc/sudoers
RUN echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER docker
WORKDIR /home/docker

##RUN sudo pacman -S $PKG
RUN git clone https://aur.archlinux.org/$PKG.git && cd $PKG && yes "" | makepkg -si && rm -r ~/$PKG

ENTRYPOINT ["bash", "-c", "echo editThisCommand."]

How to use

Just edit the second line! If it is not AUR, you can install it with pacman normally. Comment out etc. is appropriate. Writing ARG PKG = "samba" will be a file server, and writing ARG PKG = "dnsmasq" will be a DNS server.

For example

FROM archlinux/base
ARG PKG="samba"
RUN curl https://www.archlinux.org/mirrorlist/\?country\=JP\&protocol\=https\&ip_version\=4\&ip_version\=6 > /tmp/mirrorlist && sed -e "s/^#//g" /tmp/mirrorlist > /etc/pacman.d/mirrorlist && yes "" | pacman -Syy git base-devel
RUN useradd -m -s /bin/bash docker
RUN echo 'Defaults visiblepw'            >> /etc/sudoers
RUN echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

#USER docker
#WORKDIR /home/docker

RUN pacman -S $PKG
##RUN git clone https://aur.archlinux.org/$PKG.git && cd $PKG && yes "" | makepkg -si && rm -r ~/$PKG

##https://wiki.archlinux.jp/index.php/Refer to Samba
RUN  curl "https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD" > /etc/samba/smb.conf
RUN  yes "password" | pdbedit -a docker -t
RUN chmod 0777 /home/docker
ENTRYPOINT [ "bash", "-c", "nmbd -D && smbd -F </dev/null" ] ]

Recommended Posts

I want to create a Dockerfile for the time being.
I want to move selenium for the time being [for mac]
I want to create a lunch database [EP1] Django study for the first time
I want to create a lunch database [EP1-4] Django study for the first time
For the time being, I want to convert files with ffmpeg !!
I want to create a system to prevent forgetting to tighten the key 1
I want to use the Ubuntu desktop environment on Android for the time being (Termux version)
I want to use Ubuntu's desktop environment on Android for the time being (UserLAnd version)
I want to easily create a Noise Model
I want to create a window in Python
Make a histogram for the time being (matplotlib)
I played with Floydhub for the time being
I want to create a plug-in type implementation
Python: I want to measure the processing time of a function neatly
Flow memo to move LOCUST for the time being
Molecular dynamics simulation to try for the time being
I will install Arch Linux for the time being.
I want to manually create a legend with matplotlib
Next to Excel, for the time being, jupyter notebook
I want to create a nice Python development environment for my new Mac
I want to add silence to the beginning of a wav file for 1 second
I want to use Ubuntu's desktop environment on Android for the time being (Termux version-Japanese input in desktop environment)
For the time being using FastAPI, I want to display how to use API like that on swagger
[TensorFlow] I want to master the indexing for Ragged Tensor
I will try to summarize the links that seem to be useful for the time being
I tried running PIFuHD on Windows for the time being
How to create a Dockerfile (basic)
I thought I could make a nice gitignore editor, so I tried to make something like MVP for the time being
[Introduction to Reinforcement Learning] Reinforcement learning to try moving for the time being
I want to get the name of the function / method being executed
Qiskit: I want to create a circuit that creates arbitrary states! !!
I want to create a machine learning service without programming! WebAPI
I tried to create a linebot (implementation)
I want to pin Spyder to the taskbar
I want to output to the console coolly
I want to print in a comprehension
I tried to create a linebot (preparation)
I tried tensorflow for the first time
I want to handle the rhyme part1
Python Master RTA for the time being
I want to handle the rhyme part3
I want to build a Python environment
I want to display the progress bar
I want to handle the rhyme part2
I want to handle the rhyme part5
I want to handle the rhyme part4
"Stop committing Japanese files to git on Mac> <" For the time being, I wrote a script to search for incompatible Japanese files on Mac and Linux.
I tried to create serverless batch processing for the first time with DynamoDB and Step Functions
I want to create a graph with wavy lines omitted in the middle with matplotlib (I want to manipulate the impression)
I want to create a histogram and overlay the normal distribution curve on it. matplotlib edition
I want to separate the processing between test time and production environment
I want to send a signal only from the sub thread to the main thread
I want to be cursed by a pretty girl every time I sudo! !!
AtCoder writer I wrote a script to aggregate the contests for each writer
I want to identify the alert email. --Is that x a wildcard? ---
For the first time in Numpy, I will update it from time to time
I want to create a machine learning service without programming! Text classification
I want to make matplotlib a dark theme
I tried using scrapy for the first time
How to use MkDocs for the first time
I want to INSERT a DataFrame into MSSQL