-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove openssh deps move devcontainer stuff to dedicated folder
- Loading branch information
1 parent
69e1e3a
commit 94e371e
Showing
15 changed files
with
1,978 additions
and
225 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,43 @@ | ||
# Use an argument to specify the Ubuntu version, with a default | ||
ARG UBUNTU_VERSION=20.04 | ||
|
||
# Use the specified Ubuntu version from the .env file | ||
FROM ubuntu:${UBUNTU_VERSION} | ||
|
||
ARG USER_NAME=developer | ||
ARG USER_HOME=/home/developer | ||
ARG PROJECT_NAME=rencfs | ||
|
||
ENV USER_NAME=${USER_NAME} | ||
ENV USER_HOME=${USER_HOME} | ||
ENV PROJECT_NAME=${PROJECT_NAME} | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
sudo \ | ||
git \ | ||
curl \ | ||
gcc \ | ||
pkg-config \ | ||
build-essential \ | ||
libssl-dev \ | ||
fuse3 | ||
|
||
RUN useradd -m -s /bin/bash -d ${USER_HOME} ${USER_NAME} \ | ||
&& echo "${USER_NAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER_NAME} \ | ||
&& chmod 0440 /etc/sudoers.d/${USER_NAME} | ||
|
||
# Switch to the new user | ||
USER ${USER_NAME} | ||
WORKDIR ${USER_HOME} | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# Set the environment variables needed for Rust | ||
ENV PATH="${USER_HOME}/.cargo/bin:${PATH}" | ||
|
||
WORKDIR ${USER_HOME}/${PROJECT_NAME} | ||
|
||
# Command to keep the container running | ||
CMD ["sleep", "infinity"] |
File renamed without changes.
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,2 +1 @@ | ||
/target | ||
.idea |
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,43 +1,36 @@ | ||
# Use an argument to specify the Ubuntu version, with a default | ||
ARG UBUNTU_VERSION=20.04 | ||
################ | ||
##### Builder | ||
FROM alpine:3.16.0 as builder | ||
|
||
# Use the specified Ubuntu version from the .env file | ||
FROM ubuntu:${UBUNTU_VERSION} | ||
RUN apk add binutils build-base ca-certificates curl file g++ gcc make patch rust | ||
|
||
ARG USER_NAME=developer | ||
ARG USER_HOME=/home/developer | ||
ARG PROJECT_NAME=rencfs | ||
|
||
ENV USER_NAME=${USER_NAME} | ||
ENV USER_HOME=${USER_HOME} | ||
ENV PROJECT_NAME=${PROJECT_NAME} | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
sudo \ | ||
git \ | ||
curl \ | ||
gcc \ | ||
pkg-config \ | ||
build-essential \ | ||
libssl-dev \ | ||
fuse3 | ||
RUN . ~/.cargo/env && rustup target add x86_64-unknown-linux-musl | ||
|
||
RUN useradd -m -s /bin/bash -d ${USER_HOME} ${USER_NAME} \ | ||
&& echo "${USER_NAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER_NAME} \ | ||
&& chmod 0440 /etc/sudoers.d/${USER_NAME} | ||
# Cache downloaded+built dependencies | ||
#COPY Cargo.toml Cargo.lock /usr/src/rencfs/ | ||
#RUN mkdir /usr/src/rencfs/src && \ | ||
# echo 'fn main() {}' > /usr/src/rencfs/src/main.rs | ||
# | ||
#RUN . ~/.cargo/env && cd /usr/src/rencfs/ && cargo build --release && \ | ||
# rm -Rvf /usr/src/rencfs/src | ||
|
||
# Switch to the new user | ||
USER ${USER_NAME} | ||
WORKDIR ${USER_HOME} | ||
# Build our actual code | ||
COPY Cargo.toml Cargo.lock /usr/src/rencfs/ | ||
COPY src /usr/src/rencfs/src | ||
RUN . ~/.cargo/env && \ | ||
cd /usr/src/rencfs/ && \ | ||
cargo build --target x86_64-unknown-linux-musl --release | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
################ | ||
##### Runtime | ||
FROM alpine:3.16.0 AS runtime | ||
|
||
# Set the environment variables needed for Rust | ||
ENV PATH="${USER_HOME}/.cargo/bin:${PATH}" | ||
RUN apk add fuse3 | ||
|
||
WORKDIR ${USER_HOME}/${PROJECT_NAME} | ||
# Copy application binary from builder image | ||
COPY --from=builder /usr/src/rencfs/target/x86_64-unknown-linux-musl/release/rencfs /usr/local/bin | ||
|
||
# Command to keep the container running | ||
CMD ["sleep", "infinity"] | ||
# Run the application | ||
CMD ["rencfs", "--help"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.