Skip to content

Commit 3eafc16

Browse files
committed
updated sandbox scripts
1 parent 0eaf6bf commit 3eafc16

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

docker-compose.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,48 @@
11
# syntax version.
22
version: "3"
33

4+
# volumes.
45
volumes:
5-
php-alpine-cache-edge:
66
php-alpine-cache-v3.12:
77
php-alpine-cache-v3.11:
88
php-alpine-cache-v3.10:
9-
php-alpine-cache-v3.9:
10-
php-alpine-cache-v3.8:
11-
php-alpine-cache-v3.7:
129

13-
# services list.
10+
# services.
1411
services:
1512

1613
# sandbox base image
1714
sandbox:
1815
# target image.
19-
image: "php-alpine-sandbox:alpine-${ALPINE_VERSION}-php-${PHP_VERSION}"
16+
image: "codecasts/php-alpine:sandbox-v${ALPINE_VERSION}-php-${PHP_VERSION}"
2017
build:
2118
context: "sandbox"
2219
args:
2320
ALPINE_VERSION: ${ALPINE_VERSION}
2421
PHP_VERSION: ${PHP_VERSION}
2522
volumes:
23+
- "./bin:/opt/php-alpine/bin"
2624
- "./scripts/v${ALPINE_VERSION}/php-${PHP_VERSION}:/home/sandbox/php-${PHP_VERSION}"
2725
- "./.abuild:/home/sandbox/.abuild"
2826
- "./repo/v${ALPINE_VERSION}/php-${PHP_VERSION}:/home/sandbox/packages/php-${PHP_VERSION}"
2927
- "php-alpine-cache-v${ALPINE_VERSION}:/var/cache/apk"
3028

3129
# sandbox for building on alpine edge.
32-
edge:
30+
starter-images:
3331
# target image.
34-
image: "php-alpine-sandbox:alpine-edge-php-${PHP_VERSION}"
32+
image: "codecasts/php-alpine:alpine-v${ALPINE_VERSION}-php-${PHP_VERSION}"
3533
build:
36-
context: "sandbox"
34+
context: "images"
3735
args:
38-
ALPINE_VERSION: edge
36+
ALPINE_VERSION: ${ALPINE_VERSION}
3937
PHP_VERSION: ${PHP_VERSION}
40-
volumes:
41-
- "./scripts/edge/php-${PHP_VERSION}:/home/sandbox/php-${PHP_VERSION}"
42-
- "./.abuild:/home/sandbox/.abuild"
43-
- "./repo/edge/php-${PHP_VERSION}:/home/sandbox/packages/php-${PHP_VERSION}"
44-
- "php-alpine-cache-edge:/var/cache/apk"
4538

4639
# sandbox for building on alpine edge.
47-
starter-images:
40+
release-image:
4841
# target image.
49-
image: "codecasts/alpine-${ALPINE_VERSION}:php-${PHP_VERSION}"
42+
image: "codecasts/php-alpine:alpine-v${ALPINE_VERSION}-php-${PHP_VERSION}"
5043
build:
51-
context: "images"
44+
dockerfile: release/image/Dockerfile
45+
context: "."
5246
args:
5347
ALPINE_VERSION: ${ALPINE_VERSION}
5448
PHP_VERSION: ${PHP_VERSION}

sandbox/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ ARG APK_PACKAGER
1717
ARG APK_MAINTAINER
1818

1919
# ADD SDK AND BASIC TOOLS.
20-
RUN apk add --update-cache alpine-sdk sudo git bash nano
20+
RUN apk add --update-cache alpine-sdk ncurses sudo git bash nano
2121

2222
# CONFIGURE ALPINE REPOSITORIES AND PHP BUILD DIR.
2323
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
2424
echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories && \
2525
echo "/home/sandbox/packages/php-${PHP_VERSION}" >> /etc/apk/repositories
2626

2727
# ADD THE START SCRIPT.
28-
ADD start.sh /bin/start.sh
28+
ADD entrypoint.sh /opt/php-alpine/entrypoint.sh
2929
ADD bashrc /home/sandbox/.bashrc
3030

3131
# ADD THE PUBLIC KEY FOR REPOS.
@@ -36,7 +36,7 @@ RUN adduser -D -u 1000 sandbox && \
3636
addgroup sandbox abuild && \
3737
mkdir -p /var/cache/distfiles && \
3838
chmod a+w /var/cache/distfiles && \
39-
chmod +x /bin/start.sh && \
39+
chmod +x /opt/php-alpine/entrypoint.sh && \
4040
echo "sandbox ALL = ( ALL ) NOPASSWD: ALL" >> /etc/sudoers && \
4141
sed -i "/#PACKAGER=.*/c\PACKAGER=\"${APK_PACKAGER}\"" /etc/abuild.conf && \
4242
sed -i "/#MAINTAINER=.*/c\MAINTAINER=\"${APK_MAINTAINER}\"" /etc/abuild.conf && \
@@ -59,7 +59,7 @@ RUN mkdir -p /var/cache/apk && \
5959
USER sandbox
6060

6161
# CONFIGURE ENTRYPOINT.
62-
ENTRYPOINT ["/bin/start.sh"]
62+
ENTRYPOINT ["/opt/php-alpine/entrypoint.sh"]
6363

6464
# START ON SANDBOX USER HOME.
6565
WORKDIR "/home/sandbox/php-${PHP_VERSION}"

0 commit comments

Comments
 (0)