@@ -15,7 +15,8 @@ ARG APK_PACKAGER
1515ARG APK_MAINTAINER
1616
1717# make args available as env vars.
18- ENV ALPINE_VERSION=${ALPINE_VERSION} \
18+ ENV ENV="/etc/profile" \
19+ ALPINE_VERSION=${ALPINE_VERSION} \
1920 APK_PACKAGER=${APK_PACKAGER} \
2021 APK_MAINTAINER=${APK_MAINTAINER} \
2122 APORTS=/home/sandbox/scripts \
@@ -24,8 +25,7 @@ ENV ALPINE_VERSION=${ALPINE_VERSION} \
2425 EDITOR=nano
2526
2627# install some required tools.
27- RUN apk add \
28- --update-cache \
28+ RUN apk add --update-cache \
2929 alpine-sdk \
3030 aports-build \
3131 ncurses \
@@ -34,13 +34,13 @@ RUN apk add \
3434 nano
3535
3636# configure APK repositories.
37- # RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
38- # echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
39- # echo "/home/sandbox/packages/php-${PHP_VERSION}" >> /etc/apk/repositories
37+ RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
38+ echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
4039
41- # add entrypoint script and a cool bashrc.
42- ADD entrypoint.sh /opt/php-alpine/entrypoint.sh
43- ADD bashrc /home/sandbox/.bashrc
40+ # add opt scripts.
41+ ADD opt /opt
42+ # add etc configuration.
43+ ADD etc /etc
4444
4545# ADD THE PUBLIC KEY FOR REPOS.
4646# COPY ${APK_PUB_KEY} /etc/apk/keys/php-alpine.rsa.pub
@@ -54,11 +54,13 @@ RUN adduser -D -u 1000 sandbox && \
5454 mkdir -p /var/cache/apk && \
5555 ln -s /var/cache/apk /etc/apk/cache && \
5656 echo "sandbox ALL = ( ALL ) NOPASSWD: ALL" >> /etc/sudoers && \
57+ echo "Set disable_coredump false" >> /etc/sudo.conf && \
5758 sed -i "/export JOBS=.*/c\e xport JOBS=$(cat /proc/cpuinfo | grep '^processor\s *:\s [0-9]*$' | wc -l)" /etc/abuild.conf && \
5859 sed -i "/#USE_CCACHE=.*/c\U SE_CCACHE=1" /etc/abuild.conf && \
5960 sed -i "/#PACKAGER=.*/c\P ACKAGER=\" ${APK_PACKAGER}\" " /etc/abuild.conf && \
6061 sed -i "/#MAINTAINER=.*/c\M AINTAINER=\" ${APK_MAINTAINER}\" " /etc/abuild.conf && \
61- chown -R sandbox:sandbox /home/sandbox
62+ chown -R sandbox:sandbox /home/sandbox && \
63+ chown -R sandbox:sandbox /opt/php-alpine
6264
6365# required for running "aports-build" tool.
6466RUN mkdir -p /var/run/mqtt-exec.aports-build && \
@@ -79,4 +81,4 @@ ENTRYPOINT ["/opt/php-alpine/entrypoint.sh"]
7981WORKDIR "/home/sandbox/scripts"
8082
8183# use bash as default command.
82- CMD ["/bin/bash " ]
84+ CMD ["/usr/ bin/env" , "ash " ]
0 commit comments