Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
updated build
Browse files Browse the repository at this point in the history
  • Loading branch information
bartr committed Jul 11, 2023
1 parent 2d96437 commit 2c3a626
Show file tree
Hide file tree
Showing 24 changed files with 25 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
curl -o library-scripts/sshd-debian.sh -fsSL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/sshd-debian.sh
curl -o library-scripts/terraform-debian.sh -fsSL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/terraform-debian.sh
curl -o library-scripts/dapr-debian.sh -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
chmod +x library-scripts/*.sh
chmod +x local-scripts/*.sh
- name: Docker Build Jumpbox
run: |
Expand Down
20 changes: 3 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,24 @@ ENV PATH $PATH:/usr/local/go/bin:/home/${USERNAME}/go/bin:/home/${USERNAME}/bin:
# We intentionally create multiple layers so that they pull in parallel which improves startup time
###

RUN mkdir -p /home/${USERNAME}/bin && \
mkdir -p /home/${USERNAME}/.local/bin && \
mkdir -p /home/${USERNAME}/.dotnet/tools && \
mkdir -p /home/${USERNAME}/.dapr/bin && \
mkdir -p /home/${USERNAME}/.ssh && \
mkdir -p /home/${USERNAME}/.oh-my-zsh/completions && \
mkdir -p /home/${USERNAME}/go/bin && \
chsh --shell /bin/zsh vscode

# copy the stup scripts to the image
COPY library-scripts/*.sh /scripts/
COPY local-scripts/*.sh /scripts/

# run local script
# run base setup
RUN /bin/bash /scripts/base-setup.sh

# use scripts from: https://github.com/microsoft/vscode-dev-containers/tree/main/script-library
# uncomment this if you use a base image other than a Codespaces image
# RUN /bin/bash /scripts/common-debian.sh
RUN /bin/bash /scripts/docker-in-docker-debian.sh
RUN /bin/bash /scripts/kubectl-helm-debian.sh
RUN /bin/bash /scripts/azcli-debian.sh
RUN /bin/bash /scripts/go-debian.sh
RUN /bin/bash /scripts/dapr-debian.sh

# run local scripts
# run docker-in-docker script
RUN /bin/bash /scripts/dind-debian.sh

# run upgrade
RUN apt-get upgrade -y && \
apt-get autoremove -y && \
apt-get clean -y
Expand All @@ -77,10 +67,6 @@ RUN dotnet tool install -g webvalidate && \

USER root

# customize first run message
RUN echo "👋 Welcome to the Docker-in-Docker Codespaces image\n" >> /usr/local/etc/vscode-dev-containers/first-run-notice.txt && \
chmod +x /scripts

# docker pipe
VOLUME [ "/var/lib/docker" ]

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ scripts :
@curl -o library-scripts/sshd-debian.sh -fsSL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/sshd-debian.sh
@curl -o library-scripts/terraform-debian.sh -fsSL https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/terraform-debian.sh
@curl -o library-scripts/dapr-debian.sh -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
@chmod +x library-scripts/*.sh
@chmod +x local-scripts/*.sh

dind : scripts
@docker build . --target dind -t ghcr.io/cse-labs/dind:beta
Expand Down
Empty file modified library-scripts/azcli-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/common-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/dapr-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/docker-in-docker-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/git-lfs-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/github-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/go-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/gradle-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/java-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/kubectl-helm-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/maven-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/node-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/powershell-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/python-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/ruby-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/rust-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/sshd-debian.sh
100644 → 100755
Empty file.
Empty file modified library-scripts/terraform-debian.sh
100644 → 100755
Empty file.
24 changes: 18 additions & 6 deletions local-scripts/base-setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

if [ "$(id -u)" -ne 0 ]; then
echo 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
echo "(!) $0 failed!"
exit 1
fi

mkdir -p /home/${USERNAME}/bin
mkdir -p /home/${USERNAME}/.local/bin
mkdir -p /home/${USERNAME}/.dotnet/tools
mkdir -p /home/${USERNAME}/.dapr/bin
mkdir -p /home/${USERNAME}/.ssh
mkdir -p /home/${USERNAME}/.oh-my-zsh/completions
mkdir -p /home/${USERNAME}/go/bin
chsh --shell /bin/zsh vscode

# customize first run message
echo "👋 Welcome to the Docker-in-Docker Codespaces image\n" >> /usr/local/etc/vscode-dev-containers/first-run-notice.txt

apt-get update
apt-get -y install --no-install-recommends apt-utils dialog apt-transport-https ca-certificates curl git wget openssl
apt-get -y install --no-install-recommends software-properties-common make build-essential jq bash-completion gettext iputils-ping dnsutils
Expand All @@ -26,12 +44,6 @@ apt-get -y install --no-install-recommends dotnet-sdk-5.0 dotnet-sdk-6.0 dotnet-
# this fails the first time
curl https://certs.godaddy.com/repository/gd_bundle-g2.crt

if [ "$(id -u)" -ne 0 ]; then
echo 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
echo "(!) $0 failed!"
exit 1
fi

# install GoDaddy CA certs
mkdir -p /usr/local/share/ca-certificates
curl -Lo /usr/local/share/ca-certificates/gd_bundle-g2.crt https://certs.godaddy.com/repository/gd_bundle-g2.crt
Expand Down
Empty file modified local-scripts/dind-debian.sh
100644 → 100755
Empty file.
Empty file modified local-scripts/kind-k3d-debian.sh
100644 → 100755
Empty file.

0 comments on commit 2c3a626

Please sign in to comment.