Skip to content

Commit

Permalink
Merge pull request #263 from openwallet-foundation/feat/dev-docker-fix
Browse files Browse the repository at this point in the history
fix: dev docker container
  • Loading branch information
nodlesh authored Dec 19, 2024
2 parents 68ea8df + 19a74b7 commit 9067a86
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 47 deletions.
30 changes: 19 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,36 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Mobile Wallet Test Dev",
//"workspaceMount": "source=${localWorkspaceFolder}/aries-mobile-tests,target=/aries-mobile-tests,type=bind",
//"workspaceFolder": "/aries-mobile-tests",
// Use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
// Path is relative to the devcontainer.json file.
// Path is relative to the devcontainer.json file.
"context": "../aries-mobile-tests",
"dockerfile": "../aries-mobile-tests/Dockerfile.dev-harness"
},
"appPort": ["49160:49160"],

// Features to add to the dev container. More info: https://containers.dev/features.
// Features to add to the dev container.
// More info: https://containers.dev/features.
"features": {
"docker-from-docker": "latest"
},

// If using a local android device/emulator you will need to mount to the location of the app apk so that it can be installed.
// Change this to your absolute path to the location of the android apk you want to test with
// If using a local android device/emulator you will need to mount to the
// location of the app apk so that it can be installed.
// Change this to your absolute path to the location of the android
// apk you want to test with
"mounts": [
{ "source": "/Users/Shel/Projects/BC.gov/apps/bc-wallet", "target": "/bc-wallet/app", "type": "bind" },
{ "source": "/Users/Shel/Library/Developer/Xamarin/android-sdk-macosx/emulator/resources","target": "/qrcodes", "type": "bind" }
{
"source": "FULL_PATH_TO_MOBILE_WALLET",
"target": "/bifold-wallet/app",
"type": "bind" },
{
"source": "/PATH_TO_ANDROID_SDK/Android/sdk/emulator/resources",
"target": "/qrcodes",
"type": "bind" }
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// Use 'forwardPorts' to make a list of ports inside the
// container available locally.
"forwardPorts": [4723, 5037, 8554, 49160],

"initializeCommand": "docker network inspect aath_network >/dev/null 2>&1 || docker network create aath_network",
Expand Down Expand Up @@ -62,6 +69,7 @@
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// Uncomment to connect as root instead.
// More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
33 changes: 15 additions & 18 deletions aries-mobile-tests/Dockerfile.dev-harness
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM python:3.9-bullseye
FROM python:3.9-bullseye AS base

ARG TARGETARCH

# Install sudo
RUN apt-get update && apt-get install -y sudo
RUN apt-get update && \
apt-get install -y sudo chromium wget unzip openjdk-11-jdk && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN apt update && apt install -y chromium
FROM base

# workaround for chromium crash reports warning
RUN mkdir -p "/root/.config/chromium/Crash Reports/pending"

#Setup Android SDK
# Install necessary tools
RUN apt-get update && apt-get install -y wget unzip openjdk-11-jdk

# Set JAVA_HOME environment variable
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV PATH $PATH:$JAVA_HOME/bin
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${TARGETARCH}
ENV PATH=$PATH:$JAVA_HOME/bin

# Download and unzip Android SDK command line tools
RUN mkdir -p /usr/local/android-sdk && \
Expand All @@ -29,15 +30,11 @@ RUN mv /usr/local/android-sdk/cmdline-tools /usr/local/android-sdk/cmdline-tools
rm -r /usr/local/android-sdk/cmdline-tools-temp

# Set environment variable
ENV ANDROID_HOME /usr/local/android-sdk
ENV PATH $PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
ENV ANDROID_HOME=/usr/local/android-sdk
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools

# Accept Android SDK licenses
RUN yes | sdkmanager --licenses

# Install platform tools that includes adb
RUN sdkmanager "platform-tools"
# Install Android Build Tools
RUN yes | sdkmanager --install "build-tools;30.0.3"

RUN yes | sdkmanager --licenses && \
sdkmanager "platform-tools" && \
yes | sdkmanager --install "build-tools;30.0.3"

36 changes: 18 additions & 18 deletions aries-mobile-tests/config.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"capabilities": {
"firstMatch": [
{
"platformName": "Android",
"appium:options": {
"app": "storage:filename=BCWallet-1459.aab",
"autoGrantPermissions": true,
"automationName": "UiAutomator2"
},
"sauce:options": {
"appiumVersion": "latest",
"fullReset": true,
"sauceLabsImageInjectionEnabled": true,
"sessionCreationRetry": "3"
}
}
]
}
"capabilities": {
"firstMatch": [
{
"platformName": "Android",
"appium:options": {
"app": "storage:filename=BCWallet-2124.aab",
"autoGrantPermissions": true,
"automationName": "UiAutomator2"
},
"sauce:options": {
"appiumVersion": "latest",
"fullReset": true,
"sauceLabsImageInjectionEnabled": true,
"sessionCreationRetry": "3"
}
}
]
}
}

0 comments on commit 9067a86

Please sign in to comment.