Skip to content

Commit

Permalink
Use locally built dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerl committed Sep 14, 2022
1 parent 4f99399 commit f33a3ce
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 67 deletions.
46 changes: 44 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
FROM fdev321123/runner-devcontainer:latest
FROM mcr.microsoft.com/vscode/devcontainers/base:0-buster

# Following the pattern of Dockerfile and base.Dockerfile established here https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux/.devcontainer
# [Option] Install zsh
ARG INSTALL_ZSH="false"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"
# [Option] Enable non-root Docker access in container
ARG ENABLE_NONROOT_DOCKER="false"
# [Option] Use the OSS Moby Engine instead of the licensed Docker Engine
ARG USE_MOBY="true"
# [Option] Engine/CLI Version
ARG DOCKER_VERSION="latest"

# Enable new "BUILDKIT" mode for Docker CLI
ENV DOCKER_BUILDKIT=1

# https://github.com/microsoft/vscode-dev-containers/issues/1617
ENV IGNORE_NOTICE=true

ARG USERNAME=automatic
ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY library-scripts/*.sh /tmp/library-scripts/
RUN apt-get update \
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
# Use Docker script from script library to set things up
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh "${ENABLE_NONROOT_DOCKER}" "${USERNAME}" "${USE_MOBY}" "${DOCKER_VERSION}" \
# Clean up
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/

VOLUME [ "/var/lib/docker" ]

# Setting the ENTRYPOINT to docker-init.sh will start up the Docker Engine
# inside the container "overrideCommand": false is set in devcontainer.json.
# The script will also execute CMD if you need to alter startup behaviors.
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]

RUN apt update && apt-get install -y --allow-downgrades dotnet-sdk-6.0=6.0.300-1
RUN apt-get install build-essential -y
COPY init.sh /var/init.sh

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
17 changes: 0 additions & 17 deletions .devcontainer/Makefile

This file was deleted.

46 changes: 0 additions & 46 deletions .devcontainer/base.Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
{
"name": "Acrtions Runner Codespaces",
"dockerFile": "base.Dockerfile",
"dockerFile": "Dockerfile",
"runArgs": ["--init", "--privileged"],
"mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
"overrideCommand": false,
Expand Down
1 change: 0 additions & 1 deletion .devcontainer/first-run-notice.txt

This file was deleted.

0 comments on commit f33a3ce

Please sign in to comment.