-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile for local development
Closes #59
- Loading branch information
1 parent
ef71b1b
commit dd2715c
Showing
6 changed files
with
173 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC1091 | ||
|
||
CLICOLOR=1 | ||
# shellcheck disable=SC2016 | ||
LESS='-R --use-color -Dd+r$Du+b$' | ||
LSCOLORS="Ea" | ||
PS1="[\[$(tput sgr0)\]\[\033[38;5;1m\]\u\[$(tput sgr0)\]\[\033[3f8;5;15m\]@\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;6m\]\H\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;46m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]]{\[$(tput sgr0)\]\[\033[38;5;57m\]\$?\[$(tput sgr0)\]\[\033[38;5;15m\]} \[$(tput sgr0)\]" | ||
|
||
# shellcheck disable=SC1091 | ||
if [ -f /usr/share/bash-completion/bash_completion ]; then | ||
source /usr/share/bash-completion/bash_completion | ||
fi | ||
|
||
SYMENV_DIR="$HOME/.symbiont" | ||
|
||
# This loads symenv | ||
if [ -s "$SYMENV_DIR/symenv.sh" ]; then | ||
/bin/bash "$SYMENV_DIR/symenv.sh" | ||
fi | ||
# This loads symenv managed SDK | ||
if [ -s "$SYMENV_DIR/versions/current" ]; then | ||
PATH="$SYMENV_DIR/versions/current/bin:$PATH" | ||
export PATH | ||
fi | ||
|
||
# This loads symenv bash_completion | ||
if [ -s "$SYMENV_DIR/bash_completion" ]; then | ||
source "$SYMENV_DIR/bash_completion" | ||
fi | ||
|
||
export CLICOLOR | ||
export LESS | ||
export LSCOLORS | ||
export PS1 | ||
export PATH |
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,10 @@ | ||
#!/usr/bin/zsh | ||
|
||
export SYMENV_DIR="$HOME/.symbiont" | ||
|
||
# This loads symenv | ||
[ -s "$SYMENV_DIR/symenv.sh" ] && \. "$SYMENV_DIR/symenv.sh" | ||
# This loads symenv managed SDK | ||
[ -s "$SYMENV_DIR/versions/current" ] && export PATH="$SYMENV_DIR/versions/current/bin":$PATH | ||
# This loads symenv bash_completion | ||
[ -s "$SYMENV_DIR/bash_completion" ] && \. "$SYMENV_DIR/bash_completion" |
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,19 @@ | ||
FROM archlinux/archlinux:base-devel | ||
RUN pacman -Syyu --noconfirm \ | ||
bash_completion \ | ||
curl \ | ||
git \ | ||
jq \ | ||
unzip \ | ||
vim \ | ||
wget \ | ||
zip \ | ||
zsh \ | ||
&& ln -sfv /usr/bin/vim /usr/bin/vi \ | ||
&& mkdir -pv /usr/src/symenv/docker | ||
WORKDIR /usr/src/symenv | ||
COPY docker/test.sh /usr/src/symenv/docker/test.sh | ||
RUN /bin/bash /usr/src/symenv/docker/test.sh | ||
COPY docker/.zshrc /root/.zshrc | ||
COPY docker/.bashrc /root/.bashrc | ||
CMD ["/bin/bash"] |
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,54 @@ | ||
# Symenv Docker Build | ||
|
||
There are two steps here. | ||
|
||
1. Build the Docker image to run locally. | ||
|
||
```shell | ||
docker build -t ghcr.io/platonic-io/symenv:${USER}-$(date +%Y-%m-%d) -f docker/Dockerfile --progress plain . | ||
``` | ||
|
||
2. Add required volumes. | ||
1. The Symbiont Node requires this repository and the | ||
symbiont-node repository to run. Provide these with bind mounts or | ||
volumes. | ||
2. To use a bind mount | ||
1. Clone the symbiont-node repository to the parent | ||
directory of this repository's root | ||
2. Run the container using the bind mount step below | ||
3. To use volumes | ||
1. Create the volumes | ||
|
||
```shell | ||
docker volume create symenv | ||
docker volume create symbiont-node | ||
``` | ||
|
||
2. Run the container using the volumes step below | ||
3. Copy the repositories into each volume once the container is running | ||
|
||
```shell | ||
SYMBIONT_NODE_REPO_PATH="/home/${USER}/Documents/src/github.com/platonic-io/symbiont-node" | ||
SYMENV_REPO_PATH="/home/${USER}/Documents/src/github.com/platonic-io/symenv" | ||
docker copy $SYMBIONT_NODE_REPO_PATH symbiont-node:/usr/src/symbiont-node | ||
docker copy $SYMENV symenv:/usr/src/symenv | ||
``` | ||
|
||
3. Run a container named `symenv` with the image we just built. | ||
1. Using a bind mount. | ||
|
||
```shell | ||
docker run --name symenv \ | ||
-v /home/${USER}/Documents/src/github.com/platonic-io/symbiont-node:/usr/src/symbiont-node \ | ||
-v $(pwd):/usr/src/symenv -it ghcr.io/platonic-io/symenv:${USER}-${date +%Y-%m-%d} bash | ||
``` | ||
|
||
2. Using volumes | ||
|
||
```shell | ||
docker run --name symenv \ | ||
-v symenv:/usr/src/symenv \ | ||
-v symbiont-node:/usr/src/symbiont-node \ | ||
-it ghcr.io/platonic-io/symenv:${USER}-${date +%Y-%m-$d} bash | ||
``` |
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,9 @@ | ||
#!/usr/bin/env sh | ||
|
||
SYM_DIR="$(pwd)" | ||
|
||
export SYM_DIR | ||
|
||
if [ -s "$SYM_DIR/symenv.sh" ]; then | ||
/bin/sh "$SYM_DIR/symenv.sh" | ||
fi |