Play framework sbt docker:publishLocal showing Errors - scala

I created a new project from play template https://www.playframework.com/documentation/2.8.x/NewApplication
But when i run sbt docker:publishLocal i get the below errors . However the images are correctly created. Why is this happening any idea
[error] #1 [internal] load build definition from Dockerfile
[error] #1 sha256:53a6b23aa3772e7eb99dd566338d753cd5d899249093b40f32adc07835722c13
[error] #1 transferring dockerfile: 526B 0.0s done
[error] #1 DONE 0.0s
[error] #2 [internal] load .dockerignore
[error] #2 sha256:350be12e6072f0d32b32ceba390671a7665ca3512bbcb5eda1720e410e991677
[error] #2 transferring context: 2B done
[error] #2 DONE 0.0s
[error] #3 [internal] load metadata for docker.io/library/openjdk:8
[error] #3 sha256:14e0bc6c3291bf6e9518cae71297359a975961fa3661ed2418806c53bda51bdd
[error] #3 DONE 1.6s
[error] #4 [1/4] FROM docker.io/library/openjdk:8#sha256:5d1f52c5be872d4d460033f37490817698925737c049d987bb8ff834e3a558c3
[error] #4 sha256:7eed1880b472f1d1d2076a94c5e1fba6b6aeb0738f2b045e7a8aa9ade5add0df
[error] #4 DONE 0.0s
[error] #7 [internal] load build context
[error] #7 sha256:5068512a79803fdbfc3ee2ce534ba7f99fc6b7a060e41052287faaa6634584c5
[error] #7 transferring context: 9.32MB 0.3s done
[error] #7 DONE 0.3s
[error] #5 [2/4] RUN id -u demiourgos728 1>/dev/null 2>&1 || (( getent group 0 1>/dev/null 2>&1 || ( type groupadd 1>/dev/null 2>&1 && groupadd -g 0 root || addgroup -g 0 -S root )) && ( type useradd 1>/dev/null 2>&1 && useradd --system --create-home --uid 1001 --gid 0 demiourgos728 || adduser -S -u 1001 -G root demiourgos728 ))
[error] #5 sha256:8751f82b5efd290415e61279d9f0ad6cfafc2b41b1ac753314f9624e08a09417
[error] #5 CACHED
[error] #6 [3/4] WORKDIR /opt/docker
[error] #6 sha256:5ade8249febc039cbe5475398c41ba29e337327601620ca635630de757c83c82
[error] #6 CACHED
[error] #8 [4/4] COPY --chown=demiourgos728:root opt /opt
[error] #8 sha256:c2453d0d1ed92baf5baf84b413099df2a62a95dcc3dfb6c95da29392eed87ced
[error] #8 CACHED
[error] #9 exporting to image
[error] #9 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
[error] #9 exporting layers done
[error] #9 writing image sha256:2dca717a84b648196cf83e74e164aaf3fe9ad72568a3ce6d1589d7efff7ea061 done
[error] #9 naming to docker.io/library/restaurant_api:1.0-SNAPSHOT done
[error] #9 DONE 0.0s

These are not error messages. Docker prints some of its output to stderr and the internal logger renders it as an error.
No Error though. There are a few discussions on GitHub ☺️
Cheers,
Muki

Related

Build error when using VS Code and docker

I'm trying to follow this: https://github.com/ecarlson94/vscode-flutter-dev-container
but hitting a build error and not able to proceed.
[+] Building 68.4s (9/10)
=> [internal] load build definition from Dockerfile-with-features 0.0s
=> => transferring dockerfile: 4.07kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> [dev_container_auto_added_stage_label 1/7] FROM docker.io/library/ubu 0.0s
=> CACHED [dev_container_auto_added_stage_label 2/7] RUN apt update && 0.0s
=> CACHED [dev_container_auto_added_stage_label 3/7] RUN APT-GET autorem 0.0s
=> CACHED [dev_container_auto_added_stage_label 4/7] RUN GROUPADD --gid 0.0s
=> CACHED [dev_container_auto_added_stage_label 5/7] RUN curl -C - --out 0.0s
=> ERROR [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "sy 68.3s
------
> [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "system-images;and
roid-33;google_apis;x86_64" && avdmanager create avd -n Android33 -k "syste
m-images;android-33;google_apis;x86_64":
#9 1.994 Loading package information...
[=======================================] 100% Unzipping... x86_64/data/misc/mod
#9 67.90 Loading local repository...
Auto-selecting single ABI x86_64========] 100% Fetch remote repository...
#9 68.21 Do you wish to create a custom hardware profile? [no] offset 0, count -
1, length 256
------
error: failed to solve: executor failed running [/bin/sh -c sdkmanager "system-i
mages;android-${ANDROID_PLATFORM_VERSION};google_apis;x86_64" && avdmanager c
reate avd -n Android${ANDROID_PLATFORM_VERSION} -k "system-images;android-${ANDR
OID_PLATFORM_VERSION};google_apis;x86_64"]: exit code: 1
[74609 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\Ian\AppData\Local\Temp\devcontainercli\container-features\0.29.0-1675605529067\Dockerfile-with-features -t vsc-flutter-dev-container-421d5355087fab30e642f834c99e5e5b --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer
[74609 ms] at pie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1916:1698)
[74610 ms] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[74610 ms] at async vF (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:1972)
[74610 ms] at async P7 (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:901)
[74610 ms] at async Fie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:2093)
[74610 ms] at async Vf (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:3241)
[74610 ms] at async eoe (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17324)
[74610 ms] at async Qse (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17065)
[74620 ms] Exit code 1
[74624 ms] Command failed: C:\Users\Ian\AppData\Local\Programs\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\Ian\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder tmp/devcontainers-db9859e4-fbb5-4b56-a2af-cc2ff00bf4911675605524034 --workspace-folder d:\Work\FlutterDev\projects\flutter-dev-container --workspace-mount-consistency cached --id-label devcontainer.local_folder=d:\Work\FlutterDev\projects\flutter-dev-container --id-label devcontainer.config_file=d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --log-level debug --log-format json --config d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[74624 ms] Exit code 1
Anyone have any advice please?
TIA
Cloned repo, reopened folder in containe in VS code, build

Run tests using docker compose in scala

Trying to execute integration tests using docker.
Below is the Dockerfile:
FROM openjdk:8u232
ARG SBT_VERSION=1.2.8
# Install sbt
RUN \
curl -L -o sbt-$SBT_VERSION.deb https://dl.bintray.com/sbt/debian/sbt-$SBT_VERSION.deb && \
dpkg -i sbt-$SBT_VERSION.deb && \
rm sbt-$SBT_VERSION.deb && \
apt-get update && \
apt-get install sbt && \
sbt sbtVersion
ENV WORK_DIR="/test"
USER root
COPY . ${WORK_DIR}/
RUN cd ${WORK_DIR}
RUN sbt clean it:test
Below is the docker-compose.yml:
version: '3.7'
services:
test:
build:
context: ../..
dockerfile: Dockerfile.test
restart: always
when I run docker-compose -f test.yaml up :
it gives me error:
Step 10/10 : RUN sbt clean it:test
---> Running in d9513c01439b
[warn] No sbt.version set in project/build.properties, base directory: /
[info] Set current project to root (in build file:/)
[success] Total time: 0 s, completed Jun 6, 2020 7:20:37 AM
[error] Expected ';'
[error] No such setting/task
[error] it:test
to check it i removed this line from docker file and built the image and exec into container and my tests ran fine.
The structure of my project is:
src
main
it
test
I tried executing the unit tests as well
but it gave me:
Step 10/10 : RUN sbt clean test
---> Running in c300fcf2bf53
[warn] No sbt.version set in project/build.properties, base directory: /
[info] Set current project to root (in build file:/)
[success] Total time: 0 s, completed Jun 6, 2020 7:19:13 AM
[success] Total time: 10 s, completed Jun 6, 2020 7:19:24 AM
Removing intermediate container c300fcf2bf53
---> c0215c62663d
Successfully built c0215c62663d
Successfully tagged it_it:latest
Creating it_it_1 ... done
Attaching to it_it_1
when i changed it to:
Step 10/10 : CMD sbt clean it:test
---> Running in 719b239fb7e4
Removing intermediate container 719b239fb7e4
---> f7adb19f2cb6
Successfully built f7adb19f2cb6
Successfully tagged it_it:latest
Creating it_it_1 ... done
Attaching to it_it_1
it_1 | [warn] No sbt.version set in project/build.properties, base directory: /
it_1 | [info] Set current project to root (in build file:/)
[success] Total time: 0 s, completed Jun 6, 2020 7:32:24 AM
[error] Expected ';'
it_1 | [error] No such setting/task
it_1 | [error] it:test
it_1 | [error]
How can i execute sbt it:test from dockerfile using compose?
If it was working inside the container then this must work:
ENTRYPOINT cd ${WORK_DIR} && \
sbt clean it:test
Change to next:
RUN cd ${WORK_DIR} && sbt clean it:test
Different RUN in dockerfile won't affect eachother.

Build Errors when Compiling an APK "Failed to re-package resources

When I attempt to build an APK I get these errors.
I've tried looking for info but haven't found any solutions.
Error 1:
https://pastebin.com/Fi7mpbsQ
CommandInvokationFailure: Failed to re-package resources.
C:\Program Files (x86)\Android SDK\build-tools\26.0.0\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I
rest is on pastebin
Error 2:
https://pastebin.com/GLWnZJdz
UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
UnityEditor.HostView:OnGUI()

Export usage error when doing example from sbt docs

The sbt tutorial shows this example.
$ mkdir hello
$ cd hello
$ echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
$ sbt
...
> run
...
Hi!
However, when I try it, I get this:
$ mkdir hello
$ cd hello
$ echo 'object Hi { def main(args: Array[String]) = println("Hi!") }' > hw.scala
$ sbt
[info] Set current project to hello (in build file:/Users/coryklein/playground/hello/)
[error] export usage:
[error] export <tasks>+ Executes tasks and displays the equivalent command lines.
[error]
[error] export
[error]
My sbt version
$ sbt --version
sbt launcher version 0.13.6
Am I doing something wrong here?
Here is the output of sh -x sbt
+ '[' -f /Users/coryklein/.sbtconfig ']'
+ exec /usr/local/Cellar/sbt/0.13.6/libexec/sbt
[info] Set current project to hello (in build file:/Users/coryklein/playground/hello/)
[error] export usage:
[error] export <tasks>+ Executes tasks and displays the equivalent command lines.
[error]
[error] export
[error]
I installed sbt via brew install sbt.
$ ll `which sbt`
lrwxr-xr-x 1 coryklein admin 28B Oct 14 16:03 /usr/local/bin/sbt -> ../Cellar/sbt/0.13.6/bin/sbt
I'm trying to look through the source code to figure out what the problem is, but it's difficult when a working sbt is required to build sbt from source. :(
I was unable to figure out exactly why it failed to work, but I resolved it by doing the manual install like so:
brew remove sbt
wget https://dl.bintray.com/sbt/native-packages/sbt/0.13.6/sbt-0.13.6.tgz
extract sbt-0.13.6.tgz
mv sbt/bin/sbt-launch.jar ~/bin
echo 'SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"\n
java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$#"' > ~/bin/sbt
chmod u+x ~/bin/sbt

brew install emacs error

Having issues with installing emacs through homebrew. Any ideas are appreciated - here's what I'm getting:
==> Downloading http://ftpmirror.gnu.org/emacs/emacs-24.2.tar.bz2
Already downloaded: /Library/Caches/Homebrew/emacs-24.2.tar.bz2
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file lisp/term/ns-win.el
Hunk #1 succeeded at 931 with fuzz 1 (offset -332 lines).
patching file src/nsfns.m
Hunk #1 succeeded at 2681 (offset 92 lines).
Hunk #2 succeeded at 2794 (offset 90 lines).
patching file src/nsterm.h
Hunk #1 succeeded at 116 (offset 21 lines).
patching file src/nsterm.m
Hunk #1 succeeded at 797 (offset 111 lines).
Hunk #2 succeeded at 1281 (offset 143 lines).
Hunk #3 succeeded at 1337 (offset 127 lines).
Hunk #4 succeeded at 6088 with fuzz 2 (offset 466 lines).
Hunk #5 succeeded at 6196 (offset 463 lines).
==> ./configure --prefix=/usr/local/Cellar/emacs/24.2 --without-dbus --enable-lo
checking whether make sets $(MAKE)... ./configure: /usr/local/Library/ENV/4.3/sed: /bin/bash^M: bad interpreter: No such file or directory
no
configure: error: cannot run /bin/sh build-aux/config.sub
./configure: /usr/local/Library/ENV/4.3/sed: /bin/bash^M: bad interpreter: No such file or directory
./configure: /usr/local/Library/ENV/4.3/sed: /bin/bash^M: bad interpreter: No such file or directory
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Here's the output of brew doctor:
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
aclocal
autoconf
autoheader
autom4te
automake
autoreconf
autoscan
autoupdate
clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
ecpg
ifnames
pg_config
pg_dump
pg_dumpall
pg_restore
pg_upgrade
psql
reindexdb
vacuumdb
Consider amending your PATH so that /usr/local/bin
occurs before /usr/bin in your PATH.
Warning: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!