-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Showing
2 changed files
with
83 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,65 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:0.202.7-bullseye | ||
|
||
ARG NIX_VERSION=2.18.1 | ||
ARG CHANNEL_URL=https://github.com/NixOS/nixpkgs/archive/1db42b7fe3878f3f5f7a4f2dc210772fd080e205.tar.gz | ||
|
||
ARG USER=vscode | ||
ARG UID=1000 | ||
ARG GID=${UID} | ||
ARG NIX_INSTALLER=https://releases.nixos.org/nix/nix-${NIX_VERSION}/install | ||
ARG CACHIX_NAME=composable | ||
|
||
SHELL [ "/bin/bash", "-o", "pipefail", "-o", "errexit", "-c" ] | ||
|
||
RUN export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update && \ | ||
apt-get install --yes --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
locales \ | ||
make \ | ||
acl \ | ||
sudo \ | ||
xz-utils | ||
|
||
RUN usermod --append --groups sudo ${USER} --shell /bin/bash && \ | ||
usermod --append --groups root ${USER} --shell /bin/bash && \ | ||
adduser ${USER} root && \ | ||
sed --in-place 's/%sudo.*ALL/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers | ||
|
||
RUN mkdir --parents /etc/nix/ && \ | ||
echo "sandbox = relaxed" >> /etc/nix/nix.conf && \ | ||
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf && \ | ||
passwd --delete root | ||
|
||
USER ${USER} | ||
ENV USER=${USER} | ||
|
||
ENV LOCALE_ARCHIVE=/usr/lib/locale/locale-archive | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US:en | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
# Generate en_US.UTF-8 locale | ||
RUN locale-gen en_US.UTF-8 && \ | ||
sudo dpkg-reconfigure --frontend=noninteractive locales && \ | ||
sudo locale-gen en_US.UTF-8 | ||
|
||
RUN curl --location ${NIX_INSTALLER} > ~/install.sh && \ | ||
chmod +x ~/install.sh && \ | ||
~/install.sh | ||
|
||
RUN source ~/.nix-profile/etc/profile.d/nix.sh && \ | ||
nix-channel --add ${CHANNEL_URL} nixpkgs && \ | ||
nix-channel --update | ||
|
||
RUN echo "source ~/.nix-profile/etc/profile.d/nix.sh" >> ~/.profile && \ | ||
echo "source ~/.nix-profile/etc/profile.d/nix.sh" >> ~/.bashrc | ||
|
||
WORKDIR /home/${USER}/ | ||
|
||
COPY --chown=${USER}:${USER} . . | ||
|
||
RUN source ~/.nix-profile/etc/profile.d/nix.sh && \ | ||
nix-env --set-flag priority 10 nix-${NIX_VERSION} && \ | ||
export "ARCH_OS=$(uname -m)-$(uname -s | tr '[:upper:]' '[:lower:]')" |
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,18 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/debian | ||
{ | ||
"name": "ockam", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": "." | ||
}, | ||
"remoteEnv": { | ||
"LANG": "en_US.UTF-8", | ||
"LANGUAGE": "en_US:en", | ||
"LC_ALL": "en_US.UTF-8" | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {} | ||
}, | ||
"postStartCommand": "sudo chmod 1777 /tmp/ && sudo setfacl -k /tmp" | ||
} |