-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
af62022
commit 290d631
Showing
45 changed files
with
375 additions
and
15 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
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 |
---|---|---|
|
@@ -14,6 +14,11 @@ on: | |
jobs: | ||
anchore-analysis: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
variant: | ||
- alpine | ||
- debian | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
@@ -22,6 +27,7 @@ jobs: | |
- name: Build the Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ matrix.variant }} | ||
push: false | ||
tags: ${{ env.DOCKER_IMAGE_NAME }}:latest | ||
- name: Perform Anchore analysis | ||
|
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 |
---|---|---|
|
@@ -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/[email protected] | ||
|
@@ -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/[email protected] | ||
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 }} |
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 |
---|---|---|
|
@@ -11,6 +11,11 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
variant: | ||
- alpine | ||
- debian | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
@@ -19,4 +24,5 @@ jobs: | |
- name: Build the Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ matrix.variant }} | ||
push: false |
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 |
---|---|---|
|
@@ -14,6 +14,11 @@ on: | |
jobs: | ||
dive-analysis: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
variant: | ||
- alpine | ||
- debian | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
@@ -22,6 +27,7 @@ jobs: | |
- name: Build the Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ matrix.variant }} | ||
load: true | ||
push: false | ||
tags: ${{ env.DOCKER_IMAGE_NAME }}:latest | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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.
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
File renamed without changes.
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
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 |
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,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 |
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,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 - |
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,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 |
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,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/* |
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,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 |
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,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}" |
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,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 - |
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,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/* |
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,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 |
Oops, something went wrong.