Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #52 Organize dockerfile and Fix package versions #53

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 54 additions & 68 deletions .devcontainer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM debian:bullseye-slim
FROM debian:bullseye-20230208-slim

# Prepare
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
apt-get -t stable install --no-install-recommends -y \
gosu=1.12-1+b6 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Locale
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
apt-get -t stable install --no-install-recommends -y \
locales=2.31-13+deb11u5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
Expand All @@ -29,22 +28,58 @@ ARG USERNAME=devuser
ARG GROUPNAME=devusers
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
apt-get -t stable install --no-install-recommends -y \
sudo=1.9.5p2-3 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
groupadd --gid ${GID} -o ${GROUPNAME} && \
useradd --uid ${UID} --gid ${GID} --shell /usr/bin/fish -m -o ${USERNAME} && \
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USERNAME}

# Setup shell
# Enable bullseye-backports repository
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
fish=3.1.2-3+deb11u1 \
less=551-2 \
apt-get -t stable install --no-install-recommends -y \
software-properties-common=0.96.20.2-2.1 && \
add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install basic tools and libraries
RUN \
apt-get update -y && \
apt-get -t stable install --no-install-recommends -y \
build-essential=12.9 \
ca-certificates=20210119 \
curl=7.74.0-1.3+deb11u3 && \
curl=7.74.0-1.3+deb11u3 \
g++=4:10.2.1-1 \
gcc-multilib=4:10.2.1-1 \
gcc=4:10.2.1-1 \
less=551-2 \
libbz2-dev=1.0.8-4 \
libffi-dev=3.3-6 \
libgdbm-dev=1.19-2 \
libncurses5-dev=6.2+20201114-2 \
libnss3-dev=2:3.61-1+deb11u2 \
libreadline-dev=8.1-1 \
libsqlite3-dev=3.34.1-3 \
libssl-dev=1.1.1n-0+deb11u4 \
make=4.3-4.1 \
pkg-config=0.29.2-1 \
procps=2:3.3.17-5 \
unzip=6.0-26+deb11u1 \
wget=1.21-1+deb11u1 \
zlib1g-dev=1:1.2.11.dfsg-2+deb11u2 && \
apt-get -t bullseye-backports install --no-install-recommends -y \
git=1:2.39.1-0.1~bpo11+1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Setup shell
RUN \
apt-get update -y && \
apt-get -t bullseye-backports install --no-install-recommends -y \
fish=3.5.1+ds-1~bpo11+1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gosu ${USERNAME} fish -c ' \
Expand All @@ -53,22 +88,9 @@ RUN \
fisher install pure-fish/pure \
'

# Install new git
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y software-properties-common=0.96.20.2-2.1 && \
add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main" && \
apt-get update -y && \
apt-get -t bullseye-backports install --no-install-recommends -y git=1:2.34.1-1~bpo11+1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install asdf
ARG ASDF_VERSION=0.10.2
RUN \
apt-get update -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gosu ${USERNAME} fish -c " \
git clone https://github.com/asdf-vm/asdf.git /home/${USERNAME}/.asdf --branch v${ASDF_VERSION} && \
mkdir -p /home/${USERNAME}/.config/fish/completions && \
Expand All @@ -81,48 +103,15 @@ RUN \
# cf. https://github.com/nodejs/node/blob/main/BUILDING.md#building-nodejs-on-supported-platforms
ARG NODE_VERSION=18.10.0
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
g++=4:10.2.1-1 \
make=4.3-4.1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gosu ${USERNAME} fish -c " \
asdf plugin add nodejs && \
asdf install nodejs ${NODE_VERSION} && \
asdf global nodejs ${NODE_VERSION} \
"

# Install nest and dependencies
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
procps=2:3.3.17-5 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gosu ${USERNAME} fish -c " \
npm install -g \
@nestjs/cli \
"

# Install python
ARG PYTHON_VERSION=3.10.7
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
build-essential=12.9 \
zlib1g-dev=1:1.2.11.dfsg-2+deb11u2 \
libncurses5-dev=6.2+20201114-2 \
libgdbm-dev=1.19-2 \
libnss3-dev=2:3.61-1+deb11u2 \
libssl-dev=1.1.1n-0+deb11u3 \
libreadline-dev=8.1-1 \
libffi-dev=3.3-6 \
libsqlite3-dev=3.34.1-3 \
wget=1.21-1+deb11u1 \
libbz2-dev=1.0.8-4 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
gosu ${USERNAME} fish -c " \
asdf plugin add python && \
asdf install python ${PYTHON_VERSION} && \
Expand All @@ -132,17 +121,10 @@ RUN \
asdf reshim python \
"

# Install ansible and ansible-lint
RUN \
gosu ${USERNAME} fish -c " \
python -m pip install ansible ansible-lint==6.8.0 && \
asdf reshim python \
"

# Install tools
# Install useful tools
RUN \
apt-get update -y && \
apt-get install --no-install-recommends -y \
apt-get -t stable install --no-install-recommends -y \
tmux=3.1c-1+deb11u1 \
unzip=6.0-26+deb11u1 \
openssh-client=1:8.4p1-5+deb11u1 \
Expand All @@ -163,17 +145,21 @@ RUN \
curl -L 'https://github.com/hadolint/hadolint/releases/download/v2.10.0/hadolint-Linux-x86_64' -o /usr/local/bin/hadolint && \
chmod 755 /usr/local/bin/hadolint && \
gosu ${USERNAME} fish -c " \
npm install --location=global prettier@2.7.1 && \
npm install --location=global \
prettier@2.7.1 \
@nestjs/cli && \
asdf reshim nodejs \
python -m pip install \
ansible==7.2.0 \
ansible-lint==6.8.0 && \
asdf reshim python \
"

# Copy .config/
COPY ./.devcontainer/docker/config/ /home/${USERNAME}/.config
RUN \
chown devuser:devusers -R /home/${USERNAME}/.config

ENV SAM_CLI_TELEMETRY=0

WORKDIR /workspace

EXPOSE 3000
Expand Down