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

Bump docker/build-push-action from v2.2.0 to v2.3.0 #3

Closed
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ updates:
interval: weekly

- package-ecosystem: docker
directory: /
directory: /alpine/
schedule:
interval: weekly

- package-ecosystem: docker
directory: /debian
schedule:
interval: weekly
8 changes: 7 additions & 1 deletion .github/workflows/anchore-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ on:
jobs:
anchore-analysis:
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- alpine
- debian
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build the Docker image
uses: docker/build-push-action@v2.2.0
uses: docker/build-push-action@v2.3.0
with:
context: ${{ matrix.variant }}
push: false
tags: ${{ env.DOCKER_IMAGE_NAME }}:latest
- name: Perform Anchore analysis
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ on:
jobs:
build-publish:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- variant: alpine
tagLatest: alpine
tagSuffix: alpine
- variant: debian
tagLatest: latest
tagSuffix: ""
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
Expand All @@ -23,9 +32,10 @@ jobs:
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Get release version
id: get_release_version
run: echo ::set-output name=tags::${GITHUB_REF#refs/*/v}
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/v}
- name: Build and Push the Docker image
uses: docker/build-push-action@v2.2.0
uses: docker/build-push-action@v2.3.0
with:
context: ${{ matrix.variant }}
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.get_release_version.outputs.tags }},${{ env.DOCKER_IMAGE_NAME }}:latest
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.get_release_version.outputs.tag }}${{ matrix.tagSuffix }},${{ env.DOCKER_IMAGE_NAME }}:${{ matrix.tagLatest }}
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- alpine
- debian
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build the Docker image
uses: docker/build-push-action@v2.2.0
uses: docker/build-push-action@v2.3.0
with:
context: ${{ matrix.variant }}
push: false
8 changes: 7 additions & 1 deletion .github/workflows/dive-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ on:
jobs:
dive-analysis:
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- alpine
- debian
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build the Docker image
uses: docker/build-push-action@v2.2.0
uses: docker/build-push-action@v2.3.0
with:
context: ${{ matrix.variant }}
load: true
push: false
tags: ${{ env.DOCKER_IMAGE_NAME }}:latest
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
# Visual Studio Code Development Container

`paniclobster/devcontainer-base` is an alpine-based image with a
configurable setup for different development workspaces needs.
`paniclobster/devcontainer-base` is a Docker image built upon both Alpine and
Debian with a configurable setup for different development workspaces needs.

[![build](https://github.com/paniclobster/devcontainer-base/workflows/build/badge.svg)](https://github.com/paniclobster/devcontainer-base/actions/)
[![license](https://img.shields.io/github/license/paniclobster/devcontainer-base)](https://github.com/paniclobster/devcontainer-base/blob/main/LICENSE.md)
[![docker hub](https://img.shields.io/docker/v/paniclobster/devcontainer-base?sort=semver)](https://hub.docker.com/r/paniclobster/devcontainer-base)
[![contributor covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-ff69b4.svg)](https://github.com/paniclobster/devcontainer-base/blob/main/CODE_OF_CONDUCT.md)

## Available Setups
## Alpine Available Setups

- Alpine SDK (alpine-sdk)
- Dapr CLI (dapr-cli)
- Ghostscript (ghostscript)
- Go (go, go-tools)
- Helm (helm)
- ImageMagick (imagemagick)
- Kubectl (kubernetes)
- Kustomize (kustomize)
- Minikube (minikube)
- Kubernetes (kubernetes, helm, kustomize, minikube, kind, skaffold)
- Node.js (node)
- Python 2 (python2)
- Python 3 (python3)

## Debian Available Setups

- Dapr CLI (dapr-cli)
- Ghostscript (ghostscript)
- Go (go, go-tools)
- ImageMagick (imagemagick)
- Kubernetes (kubernetes, helm, kustomize, minikube, kind, skaffold)
- Node.js (node)
- kind (kind)
- Python 2 (python2)
- Python 3 (python3)
- Skaffold (skaffold)

## Contributing

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup/setup-docker.sh → alpine/setup/setup-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DOCKER_HOST_SOCKET="/var/run/docker-host.sock"
DOCKER_SOCKET="/var/run/docker.sock"

sudo tee "${DEVCONTAINER_SETUP_DIR}/setup-docker-init.sh" >>/dev/null \
<<EOF
<<EOF
#!/usr/bin/env bash

set -e
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup/setup-python2.sh → alpine/setup/setup-python2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ sudo apk add --no-cache \
python2

# Install pip
curl https://bootstrap.pypa.io/get-pip.py | sudo python2
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python2
2 changes: 1 addition & 1 deletion setup/setup-python3.sh → alpine/setup/setup-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sudo apk add --no-cache \
python3

# Install pip
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
curl https://bootstrap.pypa.io/get-pip.py | sudo python3

# Make symlinks that are expected to exist
sudo ln -s /usr/bin/pydoc3 /usr/bin/pydoc
Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Base image
FROM debian:buster-slim

# Exit immediately if a command exits with a non-zero status
RUN set -e

# Install base dependencies
RUN apt-get update \
&& apt-get install --assume-yes \
curl \
git \
openssh-client \
nano \
sudo \
&& rm -rf /var/lib/apt/lists/*

# Create vscode user
ARG DEVCONTAINER_USERNAME=vscode
ENV DEVCONTAINER_USERNAME=$DEVCONTAINER_USERNAME
ARG GROUPNAME=$DEVCONTAINER_USERNAME
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd \
--gid $USER_GID \
$GROUPNAME \
&& useradd \
--create-home \
--home-dir /home/$DEVCONTAINER_USERNAME \
--gid $USER_GID \
--shell /bin/bash \
--uid $USER_UID \
$DEVCONTAINER_USERNAME \
&& echo $DEVCONTAINER_USERNAME ALL=\(root\) NOPASSWD:ALL >/etc/sudoers.d/$DEVCONTAINER_USERNAME \
&& chmod 0440 /etc/sudoers.d/$DEVCONTAINER_USERNAME

# Setup setup directory
ARG DEVCONTAINER_SETUP_DIR=/devcontainer/setup
ENV DEVCONTAINER_SETUP_DIR $DEVCONTAINER_SETUP_DIR
RUN mkdir -p \
$DEVCONTAINER_SETUP_DIR
COPY ./setup/*.sh $DEVCONTAINER_SETUP_DIR/
RUN chmod +x $DEVCONTAINER_SETUP_DIR/*.sh

# Add setup runner script
COPY ./scripts/devcontainer-setup.sh /usr/local/bin/devcontainer-setup
RUN chmod +x /usr/local/bin/devcontainer-setup

# Set user and workdir
USER $DEVCONTAINER_USERNAME
WORKDIR /home/$DEVCONTAINER_USERNAME
7 changes: 7 additions & 0 deletions debian/scripts/devcontainer-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

if [ ! -f "${DEVCONTAINER_SETUP_DIR}/setup-${1}.log" ]; then
exec "${DEVCONTAINER_SETUP_DIR}/setup-${1}.sh" ${@:2} 2>&1 | sudo tee "${DEVCONTAINER_SETUP_DIR}/setup-${1}.log"
fi
7 changes: 7 additions & 0 deletions debian/setup/setup-dapr-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

# Install Dapr CLI
DAPR_CLI_INSTALL_VERSION=${DAPR_CLI_VERSION:-master}
curl --location --silent "https://raw.githubusercontent.com/dapr/cli/${DAPR_CLI_INSTALL_VERSION}/install/install.sh" | sudo bash -
41 changes: 41 additions & 0 deletions debian/setup/setup-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

set -e

# Install docker
curl --location --silent "https://get.docker.com" | sudo bash -

# Install socat
sudo apt-get update \
&& sudo apt-get install --assume-yes \
procps \
socat \
&& sudo rm -rf /var/lib/apt/lists/*

# Grant docker access to user
sudo usermod --append --groups docker $DEVCONTAINER_USERNAME

# Configure docker socket
DOCKER_HOST_SOCKET="/var/run/docker-host.sock"
DOCKER_SOCKET="/var/run/docker.sock"

sudo tee "${DEVCONTAINER_SETUP_DIR}/setup-docker-init.sh" >>/dev/null \
<<EOF
#!/usr/bin/env bash

set -e

SOCAT_PATH_BASE=/tmp/vscr-dind-socat
SOCAT_LOG=\${SOCAT_PATH_BASE}.log
SOCAT_PID=\${SOCAT_PATH_BASE}.pid

if [ ! -f "\${SOCAT_PID}" ] || ! ps -p \$(cat \${SOCAT_PID}) > /dev/null; then
(sudo socat UNIX-LISTEN:${DOCKER_SOCKET},fork,mode=660,user=${DEVCONTAINER_USERNAME} UNIX-CONNECT:${DOCKER_HOST_SOCKET} 2>&1 | sudo tee -a \${SOCAT_LOG} > /dev/null & echo "\$!" | sudo tee \${SOCAT_PID} > /dev/null)
fi
EOF

sudo chmod +x "${DEVCONTAINER_SETUP_DIR}/setup-docker-init.sh"
sudo chown ${DEVCONTAINER_USERNAME}:root "${DEVCONTAINER_SETUP_DIR}/setup-docker-init.sh"

echo "${DEVCONTAINER_SETUP_DIR}/setup-docker-init.sh" | sudo tee -a /root/.bashrc >>/home/${DEVCONTAINER_USERNAME}/.bashrc
chown ${DEVCONTAINER_USERNAME} /home/${DEVCONTAINER_USERNAME}/.bashrc
9 changes: 9 additions & 0 deletions debian/setup/setup-ghostscript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

# Install Ghostscript
sudo apt-get update \
&& sudo apt-get install --assume-yes \
ghostscript \
&& sudo rm -rf /var/lib/apt/lists/*
29 changes: 29 additions & 0 deletions debian/setup/setup-go-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -e

# Install Go tools
export GOPATH=${DOCKER_GO_PATH}
go get -x -d github.com/stamblerre/gocode
go build -o gocode-gomod github.com/stamblerre/gocode
mv gocode-gomod "${GOPATH}/bin/"
go get -u -v \
github.com/acroca/go-symbols \
github.com/cweill/gotests/... \
github.com/davidrjenni/reftools/cmd/fillstruct \
github.com/fatih/gomodifytags \
github.com/go-delve/delve/cmd/dlv \
github.com/godoctor/godoctor \
github.com/haya14busa/goplay/cmd/goplay \
github.com/josharian/impl \
github.com/mdempsky/gocode \
github.com/ramya-rao-a/go-outline \
github.com/rogpeppe/godef \
github.com/sqs/goreturns \
github.com/stamblerre/gocode \
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
golang.org/x/tools/cmd/gorename \
golang.org/x/tools/cmd/guru
16 changes: 16 additions & 0 deletions debian/setup/setup-go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e

# Install go
sudo apt-get update \
&& sudo apt-get install --assume-yes \
golang
&& sudo rm -rf /var/lib/apt/lists/*

# Configure GOPATH
export GOPATH=${DOCKER_GO_PATH}
echo "export GOPATH=${GOPATH}" | tee -a /home/${DEVCONTAINER_USERNAME}/.bashrc >>/dev/null

sudo mkdir -p "${GOPATH}/bin" "${GOPATH}/src"
sudo chmod -R 777 "${GOPATH}"
7 changes: 7 additions & 0 deletions debian/setup/setup-helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e

# Install Helm
HELM_INSTALL_VERSION=${HELM_VERSION:-master}
curl --location --silent "https://raw.githubusercontent.com/helm/helm/${HELM_INSTALL_VERSION}/scripts/get-helm-3" | sudo bash -
9 changes: 9 additions & 0 deletions debian/setup/setup-imagemagick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

# Install ImageMagick
sudo apt-get update \
&& sudo apt-get install --assume-yes \
imagemagick \
&& sudo rm -rf /var/lib/apt/lists/*
8 changes: 8 additions & 0 deletions debian/setup/setup-kind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

# Install kind
curl --silent "https://api.github.com/repos/kubernetes-sigs/kind/releases" | grep browser_download | grep linux | cut -d '"' -f 4 | grep amd64 | sort | tail -n 1 | xargs curl --location --output kind --silent
sudo install kind /usr/local/bin/
sudo rm ./kind
Loading