-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
721108e
commit efcaeaa
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Set environment variables | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update and install necessary packages | ||
RUN apt-get update && apt-get install -y \ | ||
openssh-server \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
unzip \ | ||
vim \ | ||
libgc-dev \ | ||
make | ||
|
||
# Install Golang | ||
ENV GOLANG_VERSION 1.17 | ||
RUN curl -sSL "https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xz | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
|
||
# Install Rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# Set Rust environment variables | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Install myceilum | ||
ENV MYCELIUM_VERSION v0.2.3 | ||
RUN curl -sSL "https://github.com/threefoldtech/mycelium/releases/download/${MYCELIUM_VERSION}/mycelium-x86_64-unknown-linux-musl.tar.gz" | tar -C /usr/local/bin/ -xz | ||
ENV PATH="/usr/local/bin:${PATH}" | ||
|
||
# Install hero | ||
RUN curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/installer_hero.sh > /tmp/hero_install.sh | ||
RUN bash /tmp/hero_install.sh | ||
#to debug | ||
RUN bash -x /tmp/hero_install.sh | ||
|
||
# Copy entrypoint script | ||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
RUN echo PATH=${PATH} >> /root/.bashrc | ||
|
||
# Expose SSH port | ||
EXPOSE 22 | ||
|
||
# Set the entry point to the custom script | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
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,13 @@ | ||
#!/bin/bash | ||
|
||
# Set SSH public key from environment variable | ||
if [ -n "$SSH_KEY" ]; then | ||
mkdir -p /root/.ssh | ||
echo "$SSH_KEY" > /root/.ssh/authorized_keys | ||
chmod 700 /root/.ssh | ||
chmod 600 /root/.ssh/authorized_keys | ||
fi | ||
mkdir -p /run/sshd | ||
|
||
# Start the SSH server | ||
exec /usr/sbin/sshd -D |