-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from zendesk/sheen/headless_linux_doc
doc: update doc for running zcli in headless Linux
- Loading branch information
Showing
3 changed files
with
68 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Use Ubuntu 22.04 LTS as base image | ||
FROM ubuntu:22.04 | ||
|
||
# Install dependencies required for adding repositories | ||
RUN apt-get update && apt-get install -y curl gnupg2 ca-certificates lsb-release | ||
# Install required dependencies | ||
RUN apt-get update && apt-get install -y npm dbus-x11 libsecret-1-dev gnome-keyring | ||
|
||
# Make sure ca-certificates is installed | ||
RUN apt-get install -y ca-certificates | ||
|
||
# Install nvm, Node.js | ||
ENV NVM_DIR /usr/local/nvm | ||
ENV NODE_VERSION 18 | ||
|
||
# Use bash shell for the install script | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Install nvm (Note: the version might need updating) | ||
RUN mkdir -p $NVM_DIR && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash | ||
|
||
# Install Node.js 18 and set it as the default | ||
RUN source $NVM_DIR/nvm.sh \ | ||
&& nvm install $NODE_VERSION \ | ||
&& nvm alias default $NODE_VERSION \ | ||
&& nvm use default | ||
|
||
# Add nvm.sh to .bashrc for future login shells | ||
RUN echo 'export NVM_DIR="$NVM_DIR"' >> /etc/bash.bashrc \ | ||
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /etc/bash.bashrc | ||
|
||
# Add node and npm to path so the commands are available | ||
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules | ||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
|
||
RUN npm install @zendesk/zcli -g | ||
|
||
# For headless Linux: | ||
RUN echo 'export $(dbus-launch)' >> /etc/bash.bashrc | ||
# Init kerying storage by creating a default file | ||
RUN echo 'echo "123456" | gnome-keyring-daemon -r --unlock --components=secrets' >> /etc/bash.bashrc | ||
|
||
|
||
# # Set the work directory | ||
WORKDIR /app | ||
|
||
# Command to run when starting the container | ||
CMD [ "bash" ] |