Skip to content

Commit eb7b39f

Browse files
authored
Merge pull request #3 from sigmacomputing/mysql
Add mysql to actions image
2 parents 0b4e10c + bcdcc76 commit eb7b39f

File tree

3 files changed

+82
-5
lines changed

3 files changed

+82
-5
lines changed

Dockerfile

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,80 @@
1-
FROM node:10.13
1+
# NOTE(don): this is a bit of a frankenstein, combining the mysql:5.7 Dockerfile
2+
# with the node:10.15.3-stretch-slim Dockerfile. They both have the same base,
3+
# so this seems fine
4+
# https://github.com/docker-library/mysql/blob/bb7ea52db4e12d3fb526450d22382d5cd8cd41ca/5.7/Dockerfile
5+
FROM mysql:5.7.25
6+
7+
# save the mysql command wrapper from the mysql package
8+
RUN cp \
9+
/usr/local/bin/docker-entrypoint.sh \
10+
/usr/local/bin/mysql-wrapper-for-docker.sh
11+
12+
### BEGIN: add bits from node:10.15.3-stretch-slim
13+
# https://github.com/nodejs/docker-node/blob/170ed2092d4925971f9cd3ad5dfc416e820f90fd/10/stretch-slim/Dockerfile
14+
RUN groupadd --gid 1000 node \
15+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
16+
17+
ENV NODE_VERSION 10.15.3
18+
19+
RUN buildDeps='xz-utils' \
20+
&& ARCH= && dpkgArch="$(dpkg --print-architecture)" \
21+
&& case "${dpkgArch##*-}" in \
22+
amd64) ARCH='x64';; \
23+
ppc64el) ARCH='ppc64le';; \
24+
s390x) ARCH='s390x';; \
25+
arm64) ARCH='arm64';; \
26+
armhf) ARCH='armv7l';; \
27+
i386) ARCH='x86';; \
28+
*) echo "unsupported architecture"; exit 1 ;; \
29+
esac \
30+
&& set -ex \
31+
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr $buildDeps --no-install-recommends \
32+
&& rm -rf /var/lib/apt/lists/* \
33+
&& for key in \
34+
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
35+
FD3A5288F042B6850C66B31F09FE44734EB7990E \
36+
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
37+
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
38+
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
39+
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
40+
77984A986EBC2AA786BC0F66B01FBB92821C587A \
41+
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
42+
4ED778F539E3634C779C87C6D7062848A1AB005C \
43+
A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
44+
B9E2F5981AA6E0CD28160D9FF13993A75599653C \
45+
; do \
46+
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
47+
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
48+
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
49+
done \
50+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
51+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
52+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
53+
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
54+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
55+
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
56+
&& apt-get purge -y --auto-remove $buildDeps \
57+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
58+
59+
ENV YARN_VERSION 1.13.0
60+
61+
RUN set -ex \
62+
&& for key in \
63+
6A010C5166006599AA17F08146C2130DFD2497F5 \
64+
; do \
65+
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
66+
gpg --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
67+
gpg --batch --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
68+
done \
69+
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
70+
&& curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
71+
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
72+
&& mkdir -p /opt \
73+
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
74+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
75+
&& ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
76+
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz
77+
### END: add bits from node:10.15.3-stretch-slim
278

379
LABEL version="1.1.0"
480
LABEL repository="https://github.com/nuxt/actions-yarn"
@@ -17,7 +93,7 @@ RUN yarn config set unsafe-perm true
1793
# Taken from https://github.com/cypress-io/cypress-docker-images/blob/15c5bf875454a289e20587b192c4e4322787956c/base/10/Dockerfile#L3
1894
# BEGIN
1995
RUN apt-get update && \
20-
apt-get install -y \
96+
apt-get install --no-install-recommends -y \
2197
libgtk2.0-0 \
2298
libnotify-dev \
2399
libgconf-2-4 \
@@ -26,6 +102,7 @@ RUN apt-get update && \
26102
libasound2 \
27103
xvfb \
28104
jq \
105+
git \
29106
&& rm -rf /var/lib/apt/lists/*
30107

31108
# versions of local tools
@@ -37,4 +114,4 @@ RUN npm -v
37114

38115
COPY "entrypoint.sh" "/entrypoint.sh"
39116
ENTRYPOINT ["/entrypoint.sh"]
40-
CMD ["help"]
117+
CMD "yarn help"

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ else
99
echo "NPM_AUTH_TOKEN is not set"
1010
fi
1111

12-
sh -c "yarn $*"
12+
exec "$@"

test/entrypoint.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function setup() {
88
}
99

1010
@test "entrypoint runs successfully" {
11-
run $GITHUB_WORKSPACE/entrypoint.sh help
11+
run $GITHUB_WORKSPACE/entrypoint.sh yarn help
1212
echo "$output"
1313
[ "$status" -eq 0 ]
1414
}

0 commit comments

Comments
 (0)