Skip to content

Commit

Permalink
Merge pull request #8 from a5chin/feature/docker
Browse files Browse the repository at this point in the history
Fix permission
  • Loading branch information
a5chin authored Dec 18, 2024
2 parents 9cdeded + fea485f commit edee087
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@ ARG TRIVY_VERSION=0.57.1
FROM ghcr.io/aquasecurity/trivy:$TRIVY_VERSION AS trivy


FROM $BASE_IMAGE:$PYTHON_VERSION-$DEBIAN_VERSION
COPY --from=trivy --chown=vscode: /usr/local/bin/trivy /usr/local/bin/trivy

LABEL maintainer="a5chin <a5chin.origin+contact@gmain.com>"
FROM python:$PYTHON_VERSION-slim-$DEBIAN_VERSION AS builder

ARG GCLOUD_SDK_VERSION=502.0.0
ARG TFENV_VERSION=v3.0.0

SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]

# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN if [ "$(uname -m)" = 'aarch64' ]; then _ARCH=arm; else _ARCH=x86_64; fi \
&& curl -fsS "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-$GCLOUD_SDK_VERSION-linux-$_ARCH.tar.gz" \
| tar zx -C /opt \
Expand All @@ -27,5 +31,14 @@ RUN if [ "$(uname -m)" = 'aarch64' ]; then _ARCH=arm; else _ARCH=x86_64; fi \

RUN git clone --depth=1 -b $TFENV_VERSION https://github.com/tfutils/tfenv.git /opt/tfenv


FROM $BASE_IMAGE:$PYTHON_VERSION-$DEBIAN_VERSION

COPY --from=trivy --chown=vscode: /usr/local/bin/trivy /usr/local/bin/trivy
COPY --from=builder --chown=vscode: /opt/google-cloud-sdk /opt/google-cloud-sdk
COPY --from=builder --chown=vscode: /opt/tfenv /opt/tfenv

LABEL maintainer="a5chin <a5chin.origin+contact@gmain.com>"

ENV PATH=$PATH:/opt/google-cloud-sdk/bin
ENV PATH=$PATH:/opt/tfenv/bin
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Local .terraform directories
**/.terraform/*

Expand Down
Binary file removed assets/.DS_Store
Binary file not shown.

0 comments on commit edee087

Please sign in to comment.