Skip to content

Commit

Permalink
Merge pull request #11 from bitofsky/2024-04
Browse files Browse the repository at this point in the history
Docker image spec update
  • Loading branch information
bitofsky authored Apr 18, 2024
2 parents 50cb2b6 + 11f2585 commit 1630974
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 41 deletions.
73 changes: 45 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
FROM node:18.12.0-slim as builder
FROM node:20.12.2-slim

ENV DEBIAN_FRONTEND noninteractive
ENV PNPM_VERSION 8.6.12
ENV AWS_CLI 2.15.28
ENV PNPM_VERSION 9.0.2
ENV TURBO_VERSION 1.13.2
ENV TSX_VERSION 4.7.2
ENV TS_NODE 10.9.2
ENV SWC_CORE 1.4.15
ENV AWS_CLI 2.15.39

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
unzip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
software-properties-common \
ca-certificates \
build-essential \
wget \
jq \
patch \
python3 \
curl \
unzip \
git \
&& apt-get clean

# install awscli v2. see https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI}.zip" -o /tmp/awscliv2.zip \
&& unzip /tmp/awscliv2.zip -d /tmp/ \
&& /tmp/aws/install \
&& rm /tmp/awscliv2.zip \
&& rm -rf /tmp/aws

RUN curl -L "https://github.com/moby/buildkit/releases/download/v0.13.0/buildkit-v0.13.0.linux-amd64.tar.gz" -o /tmp/buildkit.tar.gz \
&& mkdir -p /tmp/buildkit \
&& tar -C /tmp/buildkit -xzf /tmp/buildkit.tar.gz \
&& mv /tmp/buildkit/bin/buildctl /usr/bin/buildctl \
&& chmod a+x /usr/bin/buildctl \
&& rm -rf /tmp/buildkit \
&& rm /tmp/buildkit.tar.gz
&& unzip /tmp/awscliv2.zip -d /tmp/ \
&& /tmp/aws/install \
&& rm /tmp/awscliv2.zip \
&& rm -rf /tmp/aws

# install node packages
RUN npm i -g pnpm@${PNPM_VERSION} turbo@${TURBO_VERSION} tsx@${TSX_VERSION} ts-node@${TS_NODE} @swc/core@${SWC_CORE}

RUN curl -L "https://github.com/moby/buildkit/releases/download/v0.11.4/buildkit-v0.11.4.linux-amd64.tar.gz" -o /tmp/buildkit.tar.gz \
&& mkdir -p /tmp/buildkit \
&& tar -C /tmp/buildkit -xzf /tmp/buildkit.tar.gz \
&& mv /tmp/buildkit/bin/buildctl /usr/bin/buildctl \
&& chmod a+x /usr/bin/buildctl \
&& rm -rf /tmp/buildkit \
&& rm /tmp/buildkit.tar.gz

# install kubectl
COPY --link --from=bitnami/kubectl:1.29.2 /opt/bitnami/kubectl/bin/kubectl /usr/bin/kubectl
RUN curl -L "https://dl.k8s.io/release/v1.27.12/bin/linux/amd64/kubectl" -o "/usr/bin/kubectl-v1.27" \
&& curl -L "https://dl.k8s.io/release/v1.28.8/bin/linux/amd64/kubectl" -o "/usr/bin/kubectl-v1.28" \
&& curl -L "https://dl.k8s.io/release/v1.29.3/bin/linux/amd64/kubectl" -o "/usr/bin/kubectl-v1.29" \
&& curl -L "https://dl.k8s.io/release/v1.30.0/bin/linux/amd64/kubectl" -o "/usr/bin/kubectl-v1.30" \
&& chmod a+x /usr/bin/kubectl*

RUN ln -s /usr/bin/kubectl-v1.24 /usr/bin/kubectl

# install golang
COPY --link --from=golang:1.20.2 /usr/local/go/ /usr/local/go/
COPY --from=golang:1.20.2 /usr/local/go/ /usr/local/go/
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:/usr/bin:${PATH}

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" && \
ln -s /bin/bash /usr/bin/bash && \
ln -s /bin/sh /usr/bin/sh && \
npm i -g pnpm@${PNPM_VERSION}
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

74 changes: 61 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,61 @@
### README.md
Container Image for Node.js and Golang Development
==================================================
Includes:
- Node.js 18.12.0
- PNPM 8.6.12
- Golang 1.20.2
- Docker base image: node:18.12.0-slim
- Additional tools: ca-certificates, awscli v2, curl, unzip
- Moby BuildKit v0.13.0
- kubectl v1.29.2

This container image is designed for both Node.js and Golang development. It includes a variety of packages and tools that will streamline your workflow and improve productivity.
# Docker Image Specifications

This document details the versions of various packages and tools included in our Docker image.

## Base Image

- **Node.js**: 20.12.2 (Slim version)

## Installed Packages

The following packages and tools are installed:

### System Tools

- **software-properties-common**
- **ca-certificates**
- **build-essential**
- **wget**
- **jq**
- **patch**
- **python3**
- **curl**
- **unzip**
- **git**

### Programming Languages and CLI Tools

- **AWS CLI**: Version 2.15.39
- **pnpm**: Version 9.0.2
- **turbo**: Version 1.13.2
- **tsx**: Version 4.7.2
- **ts-node**: Version 10.9.2
- **@swc/core**: Version 1.4.15

### Kubernetes Control Binaries

- **kubectl**:
- Version 1.27.12
- Version 1.28.8
- Version 1.29.3
- Version 1.30.0

### Additional Tools

- **buildctl** from BuildKit Version 0.11.4

### Go Programming Language

- **Go**: Version 1.20.2

## Paths

- **GOPATH**: `/go`
- All Go binaries are added to PATH, ensuring easy execution of Go applications.

## Environmental Variables

- `DEBIAN_FRONTEND`: `noninteractive`
- System paths are configured to prioritize user-installed binaries.

This Docker image is configured to provide a comprehensive development environment with multiple tools and languages, catering to various development needs.

0 comments on commit 1630974

Please sign in to comment.