Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use a basic image
FROM ubuntu:20.04

# Install required utilities
RUN apt-get update && apt-get install -y curl

# Use the secret and set the environment variable
RUN --mount=type=secret,id=some-secret \
echo "The secret is $SOME_SECRET" > /output.txt
RUN export SOME_SECRET=$(cat /secret.txt) && \
echo "The secret is $SOME_SECRET" > /output.txt && \
echo "SOME_SECRET=$SOME_SECRET" >> /etc/environment

# Copy the rest of the application
COPY . /app

# Set the working directory
WORKDIR /app

# Expose port for application
EXPOSE 80

# Start the application (e.g., a simple HTTP server)
CMD ["python3", "-m", "http.server", "80"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "My DevContainer",
"dockerComposeFile": [
"./docker-compose.yml",
"./docker-compose.override.yml"
],
"build": {
"dockerfile": "Dockerfile",
"args": {
"DOCKER_BUILDKIT": "1"
}
},
"service": "my-service",
"features": {
"docker-in-docker": {
"version": "latest",
"installDockerBuildx": true
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.8'

services:
my-service:
build:
secrets:
- some-secret
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.8'

services:
my-service:
build:
context: .
dockerfile: Dockerfile
image: my-image
environment:
- MY-SECRET=${SOME_SECRET}
ports:
- "8080:80"

secrets:
some-secret:
file: ./secret.txt

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
supersecretvalue
Loading