LoginSignup
1
1

More than 1 year has passed since last update.

SquidをDocker環境で動作させる

Posted at

ただの作業記録です。

FROM alpine:3.13
RUN apk add --no-cache squid
COPY ./squid.conf /etc/squid/squid.conf
EXPOSE 3128 # squidのport
USER squid # squidユーザで動作させる
CMD /usr/sbin/squid -N 0 # foreground & 1プロセスで動作させる
squid.conf
# ...

cache_effective_user squid # squidユーザで動作させる
pid_filename none # non-rootユーザ動作なので該当dirへの権限回避、foregroundで動作させるので、pid必要ない(はず)
logfile_rotate 0 # stdoutに出力するのでrotate必要なし 
cache_log stdio:/dev/stdout # サーバログをstdoutに出力
access_log stdio:/dev/stdout # アクセスログをstdoutに出力

cache_mem 0 MB # メモリ圧迫させたくないのでcacheしない
cache_store_log none # cacheしない場合はlogging必要なし

client_persistent_connections off # source <-> squidのHTTP keepalive やめる
server_persistent_connections off # squid <-> destinationのHTTP keepalive やめる
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1