{"action":"created","issue":{"url":"https://api.github.com/repos/Keats/gutenberg/issues/316","repository_url":"https://api.github.com/repos/Keats/gutenberg","labels_url":"https://api.github.com/repos/Keats/gutenberg/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/Keats/gutenberg/issues/316/comments","events_url":"https://api.github.com/repos/Keats/gutenberg/issues/316/events","html_url":"https://github.com/Keats/gutenberg/issues/316","id":330845828,"node_id":"MDU6SXNzdWUzMzA4NDU4Mjg=","number":316,"title":"Issue compiling in Docker","user":{"login":"nbigaouette","id":112988,"node_id":"MDQ6VXNlcjExMjk4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/112988?v=4","gravatar_id":"","url":"https://api.github.com/users/nbigaouette","html_url":"https://github.com/nbigaouette","followers_url":"https://api.github.com/users/nbigaouette/followers","following_url":"https://api.github.com/users/nbigaouette/following{/other_user}","gists_url":"https://api.github.com/users/nbigaouette/gists{/gist_id}","starred_url":"https://api.github.com/users/nbigaouette/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbigaouette/subscriptions","organizations_url":"https://api.github.com/users/nbigaouette/orgs","repos_url":"https://api.github.com/users/nbigaouette/repos","events_url":"https://api.github.com/users/nbigaouette/events{/privacy}","received_events_url":"https://api.github.com/users/nbigaouette/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-09T02:34:59Z","updated_at":"2018-06-20T16:06:14Z","closed_at":null,"author_association":"NONE","body":"I'm trying to build a docker image providing a statically linked musl binary of gutenberg (v0.3.3). This way the final docker image could contain only the static binary by using `FROM scratch`.\r\n\r\nHere's the dockerfile:\r\n```dockerfile\r\nARG RUSTC_VERSION=1.26.2\r\n\r\nFROM rust:${RUSTC_VERSION}-slim-stretch as builder\r\n\r\nENV GUTENBERG_VERSION 0.3.3\r\n\r\nRUN apt-get update -y && \\\r\n    DEBIAN_FRONTEND=noninteractive apt-get install -y -q \\\r\n    wget \\\r\n    tar \\\r\n    cmake \\\r\n    build-essential \\\r\n    musl-dev \\\r\n    musl-tools \\\r\n    libpq-dev \\\r\n    libsqlite-dev \\\r\n    libssl-dev \\\r\n    pkgconf \\\r\n    xutils-dev \\\r\n    && \\\r\n    apt-get clean && \\\r\n    rm -rf /var/lib/apt/lists/*\r\n\r\nRUN wget https://github.com/Keats/gutenberg/archive/v${GUTENBERG_VERSION}.tar.gz && \\\r\n    tar -zxvf v${GUTENBERG_VERSION}.tar.gz && \\\r\n    rm -f v${GUTENBERG_VERSION}.tar.gz\r\n\r\nRUN rustup target add x86_64-unknown-linux-musl\r\n\r\nWORKDIR gutenberg-${GUTENBERG_VERSION}\r\n\r\nENV RUST_BACKTRACE=1\r\n\r\nRUN cargo build --release\r\n\r\nFROM rust:${RUSTC_VERSION}-slim-stretch as runner\r\nCOPY --from=builder /gutenberg-${GUTENBERG_VERSION}/target/release/gutenberg .\r\nCMD [\"./gutenberg\", \"serve\"]\r\n```\r\n\r\nBuilt and ran like this: `docker build . -t gutenberg:v0.3.3 && docker run -it --rm gutenberg:v0.3.3`\r\n\r\nRight now it does not work. I've facing some issues.\r\n\r\nFirst issue is the following:\r\n```\r\nerror[E0518]: attribute should be applied to function\r\n  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/tera-0.11.6/src/parser/mod.rs:13:10\r\n   |\r\n13 | #[derive(Parser)]\r\n   |          ^^^^^^ not a function\r\n```\r\nI'm not sure to understand this error. I was able to bypass it by running `cargo update`. Here's the resulting lock file: [Cargo.lock.txt](https://github.com/Keats/gutenberg/files/2086562/Cargo.lock.txt)\r\nCould a release be done with updated dependencies? I guess that should fix this problem.\r\n\r\nSecondly, I get a linking error if I try to link to musl (`cargo build --release --target=x86_64-unknown-linux-musl`):\r\n```\r\n  = note: /gutenberg-0.3.3/target/x86_64-unknown-linux-musl/release/deps/libsass_sys-e5c815c30709cae7.rlib(sass_context.o): In fun\r\nction `_GLOBAL__sub_I_sass_context.cpp':\r\n          sass_context.cpp:(.text.startup+0x1c): undefined reference to `__dso_handle'\r\n          sass_context.cpp:(.text.startup+0x4e): undefined reference to `__dso_handle'\r\n          sass_context.cpp:(.text.startup+0xc9): undefined reference to `__dso_handle'\r\n          sass_context.cpp:(.text.startup+0xef): undefined reference to `__dso_handle'\r\n          sass_context.cpp:(.text.startup+0x118): undefined reference to `__dso_handle'\r\n          /gutenberg-0.3.3/target/x86_64-unknown-linux-musl/release/deps/libsass_sys-e5c815c30709cae7.rlib(sass_context.o):sass_co\r\nntext.cpp:(.text.startup+0x141): more undefined references to `__dso_handle' follow\r\n          /usr/bin/ld: /gutenberg-0.3.3/target/x86_64-unknown-linux-musl/release/deps/gutenberg-55708b3e089522b3: hidden symbol `_\r\n_dso_handle' isn't defined\r\n          /usr/bin/ld: final link failed: Bad value\r\n          collect2: error: ld returned 1 exit status\r\n```\r\n\r\nCould https://github.com/rust-lang/rust/pull/50105 be related?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/Keats/gutenberg/issues/comments/398805500","html_url":"https://github.com/Keats/gutenberg/issues/316#issuecomment-398805500","issue_url":"https://api.github.com/repos/Keats/gutenberg/issues/316","id":398805500,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODgwNTUwMA==","user":{"login":"Keats","id":680355,"node_id":"MDQ6VXNlcjY4MDM1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/680355?v=4","gravatar_id":"","url":"https://api.github.com/users/Keats","html_url":"https://github.com/Keats","followers_url":"https://api.github.com/users/Keats/followers","following_url":"https://api.github.com/users/Keats/following{/other_user}","gists_url":"https://api.github.com/users/Keats/gists{/gist_id}","starred_url":"https://api.github.com/users/Keats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keats/subscriptions","organizations_url":"https://api.github.com/users/Keats/orgs","repos_url":"https://api.github.com/users/Keats/repos","events_url":"https://api.github.com/users/Keats/events{/privacy}","received_events_url":"https://api.github.com/users/Keats/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T16:06:13Z","updated_at":"2018-06-20T16:06:13Z","author_association":"OWNER","body":"@nbigaouette can you try to run the Dockerfile on nightly? If it compiles fine than we can leave it as is and I'll just release a 0.3.4 version"}}
{"actor":{"display_login":"Keats"}}