H
H
HexUserHex2020-07-28 19:07:30
Docker
HexUserHex, 2020-07-28 19:07:30

Starting tor on container startup (Alpine based)?

It is required to automatically launch tor when starting the container.

How I try:
RUN rc-update add tor default

Nothing happens when starting the container... what am I missing? How to do it right?

PS: I was already thinking about trying
RUN tor&

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-07-28
@HexUserHex

rc-update manages system services that are started by the init process, which is started at system startup. In the container, exactly one program is usually launched, no initialization of the system with the launch of a bunch of processes occurs. So you have to start tor manually. Sometimes inside containers they use lightweight systems for launching services like runit, but for the sake of one tor, it’s somehow bold to deal with this.
tor needs to be run in daemon mode so that after it is started, something else can be launched. For example, make a script in which to launch tor and immediately need it:

команда_запуска_tor >/dev/null 2>&1 &
команда_запуска_моего_приложения

Put this script inside the container and use it instead of the original command.
But this is not the docker way. It's nice and Feng Shui to run tor as a separate container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question