Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71a5a8c

Browse files
committedDec 13, 2023
New al2023
1 parent 6ae383c commit 71a5a8c

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
 
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build-push-al2023
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
push:
7+
description: Push the image to ghcr.io
8+
required: false
9+
default: true
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: "vscode/devcontainers/al2023"
13+
14+
jobs:
15+
build-push:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
steps:
21+
- uses: docker/setup-buildx-action@v3
22+
23+
- uses: docker/metadata-action@v5
24+
id: meta
25+
with:
26+
images: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.IMAGE_NAME }}
27+
tags: |
28+
latest
29+
${{ github.event.inputs.UBUNTU_VERSION }}
30+
labels: |
31+
org.opencontainers.image.title=AL2023 devcontainer
32+
org.opencontainers.image.description=VS Code devcontainer: Amazon Linux 2023
33+
34+
- uses: docker/login-action@v3
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- uses: docker/build-push-action@v3
41+
with:
42+
context: '{{defaultContext}}:devcontainers/al2023'
43+
push: ${{ github.event.inputs.push }}
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+

‎devcontainers/al2023/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM amazonlinux:2023
2+
3+
RUN set -x \
4+
&& yum update \
5+
&& yum -y install \
6+
bash-completion \
7+
git \
8+
gzip \
9+
jq \
10+
sudo \
11+
tar \
12+
unzip \
13+
wget \
14+
&& yum clean all
15+
16+
# AWS CLI v2 and bash completion
17+
RUN set -x \
18+
&& curl --silent "https://awscli.amazonaws.com/awscli-exe-linux-$(uname --machine).zip" --output awscliv2.zip \
19+
&& unzip awscliv2.zip \
20+
&& ./aws/install \
21+
&& rm -rf ./aws awscliv2.zip \
22+
&& echo 'complete -C /usr/local/bin/aws_completer aws' >> /etc/bashrc
23+
24+
# Settings for root
25+
RUN set -ux \
26+
&& echo 'complete -C /usr/local/bin/aws_completer aws' >> $HOME/.bashrc
27+
28+
# Settings for vscode: authorized sudo user
29+
ARG USER_NAME=vscode
30+
RUN set -ux \
31+
&& useradd $USER_NAME \
32+
&& echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER_NAME
33+
34+
USER $USER_NAME

0 commit comments

Comments
 (0)
Please sign in to comment.