-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This provides a consistent implementation between couchbase-quickinit and couchbasefakeit. Because FakeIt has become a bit dated, it isn't compatible with modern Node or ARM64. We can have couchbase-quickinit remain more modern and install older tools (bloating size slightly) in this image for FakeIt support. Fixes #47
- Loading branch information
1 parent
3f8041a
commit a5fbc63
Showing
19 changed files
with
46 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,40 @@ | ||
ARG COUCHBASE_TAG=community-6.5.1 | ||
FROM couchbase:${COUCHBASE_TAG} | ||
|
||
# Configure apt-get for NodeJS | ||
# Install NPM and NodeJS and jq, with apt-get cleanup | ||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ | ||
apt-get install -yq build-essential nodejs jq && \ | ||
apt-get autoremove && apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Upgrade to jq 1.6 | ||
RUN wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \ | ||
chmod +x jq-linux64 && \ | ||
mv jq-linux64 $(which jq) | ||
|
||
# Install couchbase-index-manager | ||
RUN mkdir -p /npm-packages && \ | ||
npm config set prefix /npm-packages && \ | ||
npm install -g --unsafe-perm [email protected] && \ | ||
rm -rf /tmp/* /var/tmp/* | ||
ENV PATH="/npm-packages/bin:$PATH" | ||
ARG COUCHBASE_TAG=enterprise-7.2.3 | ||
FROM btburnett3/couchbase-quickinit:${COUCHBASE_TAG} as base | ||
|
||
# Install Node 12 because fakeit isn't compatible with newer versions | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && \ | ||
rm -f $HOME/.npmrc | ||
ENV NVM_DIR=/root/.nvm | ||
RUN \. $NVM_DIR/nvm.sh && \ | ||
nvm install 12.22.12 | ||
|
||
|
||
|
||
FROM base as restore | ||
|
||
# Install build essentials in a separate stage because we only need it during restore | ||
RUN apt-get update && \ | ||
apt-get install build-essential -y | ||
|
||
# Copy package.json | ||
WORKDIR /scripts | ||
WORKDIR /fakeit | ||
COPY ./scripts/package*.json ./ | ||
|
||
# Install fakeit | ||
RUN npm ci && \ | ||
rm -rf /tmp/* /var/tmp/* | ||
RUN \. $NVM_DIR/nvm.sh && \ | ||
nvm use 12.22.12 && \ | ||
npm ci | ||
|
||
# Copy startup scripts | ||
COPY ./scripts/ /scripts/ | ||
COPY ./startup/ /startup/ | ||
|
||
# Configure default environment | ||
ENV CB_DATARAM=512 CB_INDEXRAM=256 CB_SEARCHRAM=256 CB_ANALYTICSRAM=1024 CB_EVENTINGRAM=256 \ | ||
CB_SERVICES=kv,n1ql,index,fts CB_INDEXSTORAGE=forestdb \ | ||
CB_USERNAME=Administrator CB_PASSWORD=password \ | ||
FAKEIT_BUCKETTIMEOUT=5000 | ||
|
||
RUN mkdir /nodestatus | ||
VOLUME /nodestatus | ||
FROM base as final | ||
|
||
# Copy node_modules | ||
COPY --from=restore /fakeit/node_modules/ /fakeit/node_modules/ | ||
|
||
ENTRYPOINT ["./configure-node.sh"] | ||
# Copy startup scripts | ||
COPY ./scripts/ /fakeit/ | ||
RUN echo "/fakeit/run-fakeit.sh" >> /scripts/additional-init.sh | ||
|
||
# Configure default environment | ||
ENV FAKEIT_BUCKETTIMEOUT=5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.