Browse Source

build: alpine version `3.18`

dev
Dnomd343 1 year ago
parent
commit
e9f7253b2a
  1. 47
      Dockerfile

47
Dockerfile

@ -1,39 +1,24 @@
FROM alpine:3.16 AS vlmcsd FROM alpine:3.18 AS vlmcsd
ENV VLMCSD="svn1113" ENV VLMCSD="svn1113"
RUN apk add build-base RUN apk add build-base
RUN wget https://github.com/Wind4/vlmcsd/archive/refs/tags/${VLMCSD}.tar.gz && tar xf ${VLMCSD}.tar.gz RUN wget https://github.com/Wind4/vlmcsd/archive/refs/tags/${VLMCSD}.tar.gz -qO- | tar xz
WORKDIR ./vlmcsd-${VLMCSD}/ WORKDIR ./vlmcsd-${VLMCSD}/
RUN make && mv ./bin/vlmcs ./bin/vlmcsd ./etc/vlmcsd.kmd /tmp/ RUN make && mv ./bin/vlmcs ./bin/vlmcsd ./etc/vlmcsd.kmd /tmp/
FROM alpine:3.16 AS iconv FROM alpine:3.18 AS asset
ENV ICONV="1.17" RUN apk add php-fpm
RUN apk add build-base php8-dev WORKDIR /asset/etc/php81/
RUN wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV}.tar.gz && tar xf libiconv-${ICONV}.tar.gz RUN cat /etc/php81/php-fpm.conf | sed 's/^;\(pid\)/\1/;/error_log/a\error_log = /dev/stdout' > php-fpm.conf
RUN wget https://php.net/distributions/php-$(php -v | awk 'NR==1 {print $2}').tar.gz && \ WORKDIR /asset/etc/php81/php-fpm.d/
tar xf php-*.tar.gz php-$(php -v | awk 'NR==1 {print $2}')/ext/iconv --strip-components 2 RUN cat /etc/php81/php-fpm.d/www.conf | sed 's?127.0.0.1:9000?/run/php-fpm.sock?' > www.conf
WORKDIR /libiconv-${ICONV}/
RUN ./configure && make && make install && cp ./lib/.libs/libiconv.so.2 /tmp/
WORKDIR /iconv/
RUN sed -i '/blahblah/i\return 0;' config.m4 && phpize && \
./configure --with-iconv=/usr/local && make && mv ./modules/iconv.so /tmp/
RUN strip /tmp/*.so*
FROM alpine:3.16 AS asset
RUN apk add php8-fpm
WORKDIR /asset/etc/php8/
RUN cat /etc/php8/php-fpm.conf | sed 's/^;\(pid\)/\1/;/error_log/a\error_log = /dev/stdout' > php-fpm.conf
WORKDIR /asset/etc/php8/php-fpm.d/
RUN cat /etc/php8/php-fpm.d/www.conf | sed 's?127.0.0.1:9000?/run/php-fpm.sock?' > www.conf
COPY --from=vlmcsd /tmp/vlmcs* /asset/usr/bin/ COPY --from=vlmcsd /tmp/vlmcs* /asset/usr/bin/
COPY --from=iconv /tmp/libiconv.so.2 /asset/usr/local/lib/ #COPY ./nginx/ /asset/etc/nginx/
COPY --from=iconv /tmp/iconv.so /asset/usr/lib/php8/modules/ #COPY ./ /asset/kms-server/
COPY ./nginx/ /asset/etc/nginx/ #RUN ln -s /kms-server/kms.php /asset/usr/bin/kms-server
COPY ./ /asset/kms-server/
RUN ln -s /kms-server/kms.php /asset/usr/bin/kms-server
FROM alpine:3.16 FROM alpine:3.18
RUN apk add --no-cache nginx php8 php8-fpm php8-iconv php8-pcntl php8-posix RUN apk add --no-cache nginx php php-fpm php-mbstring #php-pcntl php-posix
COPY --from=asset /asset/ / COPY --from=asset /asset/ /
EXPOSE 1688/tcp 1689/tcp #EXPOSE 1688/tcp 1689/tcp
WORKDIR /kms-server/ #WORKDIR /kms-server/
ENTRYPOINT ["kms-server"] #ENTRYPOINT ["kms-server"]

Loading…
Cancel
Save